URLApplicationResource extends PostfixedApplicationResource { @Override public long getLastModified() throws IOException { if (file != null) { return file.lastModified(); } else { URLConnection connection = openConnection(); if (connection instanceof JarURLConnection) { return ((JarURLConnection) connection).getJarEntry().getTime(); } else { long result = connection.getLastModified(); return result; } } } URLApplicationResource(String localePath, URL url);  URLApplicationResource(String path, Locale locale, URL url); @Override InputStream getInputStream(); @Override long getLastModified(); @Override String toString();  }
@Test public void testGetLastModified() throws IOException { URL url = getClass().getClassLoader().getResource("org/apache/tiles/request/test/locale/resource.txt"); URLApplicationResource resource = new URLApplicationResource("org/apache/tiles/request/test/locale/resource.txt", url); assertTrue(resource.getLastModified() > 0); }
@Test public void testGetLastModifiedWithSpace() throws IOException { URL url = getClass().getClassLoader().getResource("org/apache/tiles/request/test/locale/resource with space.txt"); URLApplicationResource resource = new URLApplicationResource("org/apache/tiles/request/test/locale/resource with space.txt", url); assertTrue(resource.getLastModified() > 0); }