Skip to content

Commit

Permalink
Demonstrated try-with-resources
Browse files Browse the repository at this point in the history
  • Loading branch information
ajs6f committed Apr 12, 2013
1 parent ebf0a6d commit 9ae0ae9
Showing 1 changed file with 8 additions and 7 deletions.
Expand Up @@ -69,15 +69,16 @@ public class LegacyMethod {

private static final Logger logger = getLogger(LegacyMethod.class);

private static final String MAP_PROPERTIES =
"/org/fcrepo/messaging/legacy/map.properties";

static {
try {
InputStream is =
LegacyMethod.class
.getResourceAsStream("/org/fcrepo/messaging/legacy/map.properties");
try (final InputStream is =
LegacyMethod.class.getResourceAsStream(MAP_PROPERTIES)) {
FEDORA_TYPES.load(is);
is.close();
} catch (IOException e) { // it's in the jar.
e.printStackTrace();
} catch (IOException e) {
throw new RuntimeException(e);
// it's in the jar.
}
}

Expand Down

0 comments on commit 9ae0ae9

Please sign in to comment.