I'm getting back a URL to a file inside a JAR inside an (unzipped) WAR running in Liberty 16.0.0.4. The code is roughly:
URL url = servletContext.getResource(somePath);
URLConnection connection = url.openConnection();
long lastModified = connection.getLastModified();
The URL is of the form
"wsjar:file:/{path_to_WAR}/My.war/WEB-INF/lib/someLIB.jar!/META-INF/resources/foo/bar.txt"
I am looking for the file's timestamp, because it is used to generate etags, cache control, etc. Instead, I get the timestamp for the someLIB.jar. The jar's timestamp is meaningless and constantly changing, both during publishing from eclipse in development, and during our automated builds.
Isn't this a bug? Is there any workaround?