diff options
author | Greg Wilkins | 2013-06-03 08:21:11 +0000 |
---|---|---|
committer | Greg Wilkins | 2013-06-03 08:21:11 +0000 |
commit | 7bb3a7be282de6cc2996f8065f98aff1b26ad236 (patch) | |
tree | c1b686cef02f266e0cc6618d76b00d5298fbf812 /jetty-ant/src | |
parent | 952f8442e5f07bde3f747a799d4bc56a42a1a0bf (diff) | |
download | org.eclipse.jetty.project-7bb3a7be282de6cc2996f8065f98aff1b26ad236.tar.gz org.eclipse.jetty.project-7bb3a7be282de6cc2996f8065f98aff1b26ad236.tar.xz org.eclipse.jetty.project-7bb3a7be282de6cc2996f8065f98aff1b26ad236.zip |
409556 Resource files not closed
Made Resource a closeable so that it is easier to close in a try(){} block. Deprecated release() and made it close() instead.
FileResource no longer extends URLResource as it can more efficiently implement all the methods with pure File operations and have no
connections or streams that need to be release/closed
Diffstat (limited to 'jetty-ant/src')
-rw-r--r-- | jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java index dca34758fc..47ecd5bc0e 100644 --- a/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java +++ b/jetty-ant/src/main/java/org/eclipse/jetty/ant/AntWebAppContext.java @@ -540,9 +540,8 @@ public class AntWebAppContext extends WebAppContext if (getDescriptor() != null) { - try + try (Resource r = Resource.newResource(getDescriptor());) { - Resource r = Resource.newResource(getDescriptor()); scanList.add(r.getFile()); } catch (IOException e) @@ -553,9 +552,8 @@ public class AntWebAppContext extends WebAppContext if (getJettyEnvXml() != null) { - try + try (Resource r = Resource.newResource(getJettyEnvXml());) { - Resource r = Resource.newResource(getJettyEnvXml()); scanList.add(r.getFile()); } catch (IOException e) @@ -566,11 +564,10 @@ public class AntWebAppContext extends WebAppContext if (getDefaultsDescriptor() != null) { - try + try (Resource r = Resource.newResource(getDefaultsDescriptor());) { - if (!AntWebAppContext.WEB_DEFAULTS_XML.equals(getDefaultsDescriptor())) - { - Resource r = Resource.newResource(getDefaultsDescriptor()); + if (!WebAppContext.WEB_DEFAULTS_XML.equals(getDefaultsDescriptor())) + { scanList.add(r.getFile()); } } |