private long[] getLastModified(TldResourcePath tldResourcePath) { long[] result = new long[2]; result[0] = -1; result[1] = -1; try { String webappPath = tldResourcePath.getWebappPath(); if (webappPath != null) { // webappPath will be null for JARs containing TLDs that are on // the class path but not part of the web application URL url = servletContext.getResource(tldResourcePath.getWebappPath()); URLConnection conn = url.openConnection(); result[0] = conn.getLastModified(); if ("file".equals(url.getProtocol())) { // Reading the last modified time opens an input stream so we // need to make sure it is closed again otherwise the TLD file // will be locked until GC runs. conn.getInputStream().close(); } } try (Jar jar = tldResourcePath.openJar()) { if (jar != null) { result[1] = jar.getLastModified(tldResourcePath.getEntryName()); } } } catch (IOException e) { // Ignore (shouldn't happen) } return result; }
try (Jar jar = tldResourcePath.openJar()) {
tagFileInfo.getTagInfo().getTagLibrary().getURI()); try (Jar jar = tldResourcePath.openJar()) {
try { tagJar = compiler.getCompilationContext().getTldResourcePath( tagInfo.getTagLibrary().getURI()).openJar(); } catch (IOException ioe) { throw new JasperException(ioe);