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
No related branches found
No related tags found
No related merge requests found
......@@ -119,13 +119,23 @@ public class SLUBTechnicalMetadataExtractorMediaConchPlugin implements MDExtract
validationLog.add(line);
line = reader.readLine();
}
if (p.exitValue() == 0) {
isvalid = true;
iswellformed=true;
if (p.exitValue() == 0) { // normal execution
if ( Pattern.matches("^pass!.*", validationLog.get(0)) ) {
isvalid = true;
iswellformed = true;
} else if ( Pattern.matches("^fail!.*", validationLog.get(0)) ) {
isvalid = false;
iswellformed = false;
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
isvalid = false;
iswellformed = false;
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) {
//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