Skip to content

Commit

Permalink
close stream before copying files, refs TEIC/TEIGarage#81
Browse files Browse the repository at this point in the history
  • Loading branch information
anneferger committed Jun 4, 2024
1 parent dbbb801 commit 01f099a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>pl.psnc.dl.ege.tei</groupId>
<artifactId>tei-converter</artifactId>
<version>0.6.5</version>
<version>0.6.6</version>
<name>EGE TEI Converter</name>
<properties>

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/pl/psnc/dl/ege/tei/TEIConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@ private void performXsltTransformation(InputStream inputStream,
Serializer result = proc.newSerializer();
result.setOutputStream(fos);
transformer.applyTemplates(initialNode, result);
ior.compressData(outTempDir, outputStream);
//need to close fileoutputstreams before saving the files (see https://github.com/TEIC/TEIGarage/issues/81)
}
} finally {
try {
Expand All @@ -584,6 +584,8 @@ private void performXsltTransformation(InputStream inputStream,
} catch (Exception ex) {
// do nothing
}
//now writing the folder after streams are closed
ior.compressData(outTempDir, outputStream);
if (outTempDir != null && outTempDir.exists())
EGEIOUtils.deleteDirectory(outTempDir);
if (inTmpDir != null && inTmpDir.exists())
Expand Down

0 comments on commit 01f099a

Please sign in to comment.