@Override public long getLastModified(String name) throws IOException { try (ReferenceCountedJar jar = open()) { return jar.wrappedJar.getLastModified(name); } }
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; }
resource = resource.substring(1); result = tagJar.getLastModified(resource); } else { URL jspUrl = getResource(resource);
String entry = key.substring(entryStart + 2); try (Jar jar = JarFactory.newInstance(new URL(key.substring(4, entryStart)))) { includeLastModified = jar.getLastModified(entry);
String entry = absFileName.substring(1); compiler.getPageInfo().addDependant(jar.getURL(entry), Long.valueOf(jar.getLastModified(entry)));
try { pageInfo.addDependant(jar.getURL(entryName), Long.valueOf(jar.getLastModified(entryName))); } catch (IOException ioe) { throw new JasperException(ioe);
Long.valueOf(jar.getLastModified(tldResourcePath.getEntryName()))); Long.valueOf(jar.getLastModified(tagFilePath.substring(1)))); } else { pageInfo.addDependant(tagFilePath,