Exemplo n.º 1
0
 // Preprocess a FileObject.
 private boolean preprocess(FileObject fileObject) {
   if (TrialConfig.getPreprocessorEnabled().equals("yes")) {
     // Load the preprocessor class specified in the TrialConfig.
     // Reload each time in case the class changes behind our back.
     PreprocessorAdapter ppa = null;
     String className = TrialConfig.getPreprocessorClassName();
     try {
       Class theClass = Class.forName(className);
       ppa = (PreprocessorAdapter) theClass.newInstance();
       if (fileObject instanceof DicomObject) return ppa.process((DicomObject) fileObject);
       if (fileObject instanceof XmlObject) return ppa.process((XmlObject) fileObject);
       if (fileObject instanceof ZipObject) return ppa.process((ZipObject) fileObject);
       return ppa.process(fileObject);
     } catch (Exception ex) {
       Log.message("Exception while loading or running the preprocessor: " + className);
       logger.warn("Exception while loading or running the preprocessor: " + className);
       return false;
     }
   }
   return true;
 }