Skip to content
Snippets Groups Projects
Commit a0bd05e3 authored by Jens Steidl's avatar Jens Steidl :baby_chick: Committed by Jens Steidl
Browse files

- fix for result interpretation

parent a55c5bef
Branches
No related tags found
No related merge requests found
...@@ -119,13 +119,23 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract ...@@ -119,13 +119,23 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
validationLog.add(line); validationLog.add(line);
line = reader.readLine(); line = reader.readLine();
} }
if (p.exitValue() == 0) { if (p.exitValue() == 0) { // normal execution
if ( Pattern.matches("^pass!.*", validationLog.get(0)) ) {
isvalid = true; isvalid = true;
iswellformed = true; iswellformed = true;
} else { // something wrong } else if ( Pattern.matches("^fail!.*", validationLog.get(0)) ) {
isvalid = false; isvalid = false;
iswellformed = false; iswellformed = false;
extractionErrors = validationLog; extractionErrors = validationLog;
} else {
extractionErrors = validationLog;
System.out.println("ERROR: unexcepted mediaconch result, unable to decide if valid or invalid");
throw new Exception("ERROR: unexcepted mediaconch result, unable to decide if valid or invalid");
}
} else { // something wrong
extractionErrors = validationLog;
System.out.println("ERROR: unexcepted mediaconch exit code: " + p.exitValue());
throw new Exception("ERROR: unexcepted mediaconch exit code: " + p.exitValue());
} }
} catch (IOException e) { } catch (IOException e) {
//log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e); //log.error("exception creation socket, clamd not available at host=" + host + "port=" + port, e);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment