Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mediaconch_plugin4rosetta
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
mediaconch_plugin4rosetta
Commits
ee44d038
Commit
ee44d038
authored
4 months ago
by
Gerald Hübsch
Committed by
Gerald Hübsch
4 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix assignment to final variable and buffered reader scope.
parent
4c51eca6
No related branches found
No related tags found
No related merge requests found
Pipeline
#9034
passed
4 months ago
Stage: build
Stage: test
Stage: packaging
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/org/slub/rosetta/dps/repository/plugin/SLUBMatroskaFFV1FormatValidationPlugin.java
+15
-8
15 additions, 8 deletions
...sitory/plugin/SLUBMatroskaFFV1FormatValidationPlugin.java
with
15 additions
and
8 deletions
java/org/slub/rosetta/dps/repository/plugin/SLUBMatroskaFFV1FormatValidationPlugin.java
+
15
−
8
View file @
ee44d038
...
@@ -109,17 +109,19 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
...
@@ -109,17 +109,19 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
String
execstring
=
this
.
mediaconch_binary_path
+
" "
+
filePath
+
" -p "
+
profilePath
;
String
execstring
=
this
.
mediaconch_binary_path
+
" "
+
filePath
+
" -p "
+
profilePath
;
log
.
info
(
"executing: "
+
execstring
);
log
.
info
(
"executing: "
+
execstring
);
final
AtomicBoolean
fuse
=
new
AtomicBoolean
(
true
);
final
AtomicBoolean
fuse
=
new
AtomicBoolean
(
true
);
final
BufferedReader
procOutputReader
=
null
;
try
{
try
{
Process
p
=
Runtime
.
getRuntime
().
exec
(
execstring
);
final
Process
p
=
Runtime
.
getRuntime
().
exec
(
execstring
);
procOutputReader
=
new
BufferedReader
(
new
InputStreamReader
(
p
.
getInputStream
()));
final
ArrayList
<
String
>
procOutputLineList
=
new
ArrayList
<
String
>();
final
ArrayList
<
String
>
procOutputLineList
=
new
ArrayList
<
String
>();
// prepare thread that reads the bulky output (>> 100kByte in some cases) to prevent the buffered reader from reaching its capacity limit
// prepare thread that reads the bulky output (>> 100kByte in some cases) to prevent the buffered reader from reaching its capacity limit
Thread
procOutputReaderThread
=
new
Thread
()
{
Thread
procOutputReaderThread
=
new
Thread
()
{
public
void
run
()
{
public
void
run
()
{
BufferedReader
procOutputReader
=
null
;
try
{
try
{
procOutputReader
=
new
BufferedReader
(
new
InputStreamReader
(
p
.
getInputStream
()));
String
nextLine
=
""
;
String
nextLine
=
""
;
while
(
fuse
.
get
()
&&
(
nextLine
=
procOutputReader
.
readLine
())
!=
null
)
{
while
(
fuse
.
get
()
&&
(
nextLine
=
procOutputReader
.
readLine
())
!=
null
)
{
procOutputLineList
.
add
(
nextLine
);
procOutputLineList
.
add
(
nextLine
);
...
@@ -130,6 +132,16 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
...
@@ -130,6 +132,16 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
}
finally
{
}
finally
{
// ensure this thread terminates under all circumstances
// ensure this thread terminates under all circumstances
fuse
.
set
(
false
);
fuse
.
set
(
false
);
// cleanup all resources
if
(
procOutputReader
!=
null
)
{
try
{
procOutputReader
.
close
();
}
catch
(
IOException
e
)
{
log
.
error
(
"ERROR: closing the reader stream failed, "
+
e
.
getMessage
());
}
}
}
}
if
(
isDumpValidationResultToStdOut
())
{
if
(
isDumpValidationResultToStdOut
())
{
...
@@ -181,11 +193,6 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
...
@@ -181,11 +193,6 @@ public class SLUBMatroskaFFV1FormatValidationPlugin implements FormatValidationP
}
finally
{
}
finally
{
// ensure the while loop of procOutputReaderThread terminates under all circumstances
// ensure the while loop of procOutputReaderThread terminates under all circumstances
fuse
.
set
(
false
);
fuse
.
set
(
false
);
// cleanup all resources
if
(
procOutputReader
!=
null
)
{
procOutputReader
.
close
();
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment