Example #1
0
 private String getScriptXML(File file) {
   if (file.exists() && file.isFile()) {
     DAScript dascript = DAScript.getInstance(file);
     return dascript.toXMLString();
   }
   return "<script/>";
 }
  /**
   * Check a DicomObject and record any failing lookups in the database.
   *
   * @param fileObject the object to process.
   * @return the same FileObject if the result is true; otherwise null.
   */
  public FileObject process(FileObject fileObject) {
    String cmd;

    lastFileIn = new File(fileObject.getFile().getAbsolutePath());
    lastTimeIn = System.currentTimeMillis();

    if (fileObject instanceof DicomObject) {
      DicomObject dob = (DicomObject) fileObject;
      if (dcmScriptFile != null) {
        DAScript daScript = DAScript.getInstance(dcmScriptFile);
        scriptTable = new ScriptTable(daScript);
        lutProps = LookupTable.getProperties(lutFile);
        synchronized (this) {
          Dataset ds = dob.getDataset();
          charset = ds.getSpecificCharacterSet();
          boolean ok = checkDataset(ds);
          if (!ok) {
            try {
              recman.commit();
            } catch (Exception unable) {
            }
            ;
            if (quarantine != null) quarantine.insert(fileObject);
            return null;
          }
        }
      }
    }
    lastFileOut = new File(fileObject.getFile().getAbsolutePath());
    lastTimeOut = System.currentTimeMillis();
    return fileObject;
  }