Skip to content

Commit

Permalink
Cleaned up some resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasperson committed Jan 21, 2017
1 parent 0e4bfc6 commit 4bcfa48
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,9 @@ private static PathReference getPath(final URI resPath) throws IOException {
.build();

final Map<String, ?> env = Collections.emptyMap();
final FileSystem fs = FileSystems.newFileSystem(newResPath, env);
return new PathReference(fs.provider().getPath(newResPath), fs);
try (final FileSystem fs = FileSystems.newFileSystem(newResPath, env)) {
return new PathReference(fs.provider().getPath(newResPath), fs);
}
}))
.getOrElseThrow(x -> new IOException("Could not process the URI " + resPath, x));
}
Expand Down

0 comments on commit 4bcfa48

Please sign in to comment.