Skip to content
Snippets Groups Projects
Commit 01cd8e8e authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added truncated getErrors() to workaround Rosetta Issue...

- added truncated getErrors() to workaround Rosetta Issue https://support.proquest.com/500Do0000083LJkIAM,
- closes #8
parent 2ad94b66
No related branches found
No related tags found
No related merge requests found
Pipeline #4506 passed
......@@ -49,7 +49,7 @@
</pl:initParameters>
<pl:description>SLUB Matroska/FFV1 validation Plugin, using MediaConch to validate
FFV1/Matroska-files</pl:description>
<pl:version>1.0</pl:version>
<pl:version>1.1</pl:version>
<pl:materialType>DIGITAL</pl:materialType>
<pl:module>Preservation</pl:module>
<pl:generalType>TASK</pl:generalType>
......
......@@ -199,7 +199,22 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
@Override
public final List<String> getErrors() {
return List.copyOf(this.validationLog);
List<String> truncated = new ArrayList<String>();
int chars=0;
/* workaround for Rosetta Issue https://support.proquest.com/500Do0000083LJkIAM
* truncate to ensure not more than 2000 chars used, to
*/
for (String e: validationLog) {
if ( (chars+ e.length()) < 1900 ) {
truncated.add( e );
chars+=e.length()+1; // +1 for line ending
} else {
truncated.add ("... (the full error is truncated, because Rosetta limits, see Rosetta log for detailed output)");
log.info("truncated errors in getError");
break;
}
}
return truncated;
}
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment