Ejemplo n.º 1
0
 private void setIconProperty(
     Concept concept,
     File inDir,
     String glyphIconFileName,
     String propertyKey,
     Authorizations authorizations)
     throws IOException {
   if (glyphIconFileName != null) {
     File iconFile = new File(inDir, glyphIconFileName);
     if (!iconFile.exists()) {
       throw new RuntimeException("Could not find icon file: " + iconFile.toString());
     }
     InputStream iconFileIn = new FileInputStream(iconFile);
     try {
       StreamingPropertyValue value = new StreamingPropertyValue(iconFileIn, byte[].class);
       value.searchIndex(false);
       value.store(true);
       concept.setProperty(
           propertyKey, value, OntologyRepository.VISIBILITY.getVisibility(), authorizations);
     } finally {
       iconFileIn.close();
     }
   }
 }