Skip to content

Commit

Permalink
Merge pull request #380 from geneontology/issue-378
Browse files Browse the repository at this point in the history
Close output streams when dumping files.
  • Loading branch information
kltm committed Apr 16, 2021
2 parents 0a91235 + 8da2e23 commit 07a2e56
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -833,8 +833,8 @@ public void dumpStoredModel(IRI modelId, File folder) throws IOException {
tempFile = File.createTempFile(prefix, ".ttl");
try {
BigdataSailRepositoryConnection connection = repo.getReadOnlyConnection();
OutputStream out = new FileOutputStream(tempFile);
try {
OutputStream out = new FileOutputStream(tempFile);
// Workaround for order dependence of RDF reading by OWL API
// Need to output ontology triple first until this bug is fixed:
// https://github.com/owlcs/owlapi/issues/574
Expand All @@ -847,6 +847,7 @@ public void dumpStoredModel(IRI modelId, File folder) throws IOException {
// copy temp file to the finalFile
FileUtils.copyFile(tempFile, targetFile);
} finally {
out.close();
connection.close();
}
} catch (RepositoryException e) {
Expand Down

0 comments on commit 07a2e56

Please sign in to comment.