Skip to content

ServletWarEntity is limited to file system modification dates #868

@jgustie

Description

@jgustie

The ServletWarEntity obtains modification dates through a combination of ServletContext.getRealPath and File.lastModified. For containers which choose not to expose the real path (for security reasons, by configuration or because the resource remains packed within a WAR file) the modification date may still be available. For example, ServletContext.getResource in Tomcat may return a java.net.URL like jndi:/{hostname}/{warpath} which can be opened to obtain the modification date regardless of where the resource is stored.

If ServletWarEntity.getRepresentation was changed to use getResource either as a fall back to getRealPath or if it were used as an alternate to getResourceAsStream the modification date would be more likely to be available for use in caching decisions downstream.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions