Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close output streams when dumping files. #380

Merged
merged 1 commit into from
Apr 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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