Modifier and Type | Method and Description |
---|---|
Container |
getEnclosingContainer()
Gets the container this entry lives in..
|
long |
getLastModified()
Obtain the time that this entry was last modified
|
java.lang.String |
getName()
Gets the name of this entry.
|
java.lang.String |
getPath()
Gets the path of this entry.
|
java.lang.String |
getPhysicalPath()
Deprecated.
added purely to support getRealPath on ServletContext ..
|
java.net.URL |
getResource()
This method should return a URL suitable for the ServletContext.getResource(String path) method.
|
Container |
getRoot()
Gets the Container that represents the root of this Entries
hierarchy.
|
long |
getSize()
Obtain size of this Entries data, if any.
|
java.lang.String getName()
java.lang.String getPath()
long getSize()
long getLastModified()
java.net.URL getResource()
This method should return a URL suitable for the ServletContext.getResource(String path) method.
If this Entry represents a container then this method will not work because some implementations of this API may map more than one location to a single container. Therefore to load all of the locations that contribute to a container you should do:
Container container = entry.convertToContainer();
if (container != null) {
Collection<URI> allUrisForContainer = container.getUri();
}
This may return null if this Entry is a virtual container that does not have a real location on disk.
ServletContext.getResource(String path)
@Deprecated java.lang.String getPhysicalPath()
Get path for this Entity. Not all implementations of this interface need to support this method and should return null
if they do not support them.
If the entry is container within an archive file such as a JAR or ZIP then this will return null
.
For directories that have more than one physical location mapped to them then this will return the first mapped resource.
Container getEnclosingContainer()
Container getRoot()