Interface Entry
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Container
getEnclosingContainer()
Gets the container this entry lives in..long
getLastModified()
Obtain the time that this entry was last modifiedjava.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.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of this entry.- Returns:
- name of Entry
-
getPath
java.lang.String getPath()
Gets the path of this entry.- Returns:
- path of Entry
-
getSize
long getSize()
Obtain size of this Entries data, if any.- Returns:
- number of bytes this Entry represents.
-
getLastModified
long getLastModified()
Obtain the time that this entry was last modified- Returns:
- A long value indicating the last modified time or 0L if the value is not available
-
getResource
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.
- Returns:
- The URL pointing to this entry on disk
-
getPhysicalPath
@Deprecated java.lang.String getPhysicalPath()
Deprecated.added purely to support getRealPath on ServletContext ..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.
- Returns:
- String representing physical path on disk for this entity.. null if there is none. null is very possible.
-
getEnclosingContainer
Container getEnclosingContainer()
Gets the container this entry lives in..- Returns:
- container this entry lives in..
-
getRoot
Container getRoot()
Gets the Container that represents the root of this Entries hierarchy. eg. the Container with path "/".- Returns:
- container representing /
-
-