public interface ArtifactEntry extends EnclosedEntity
Modifier and Type | Method and Description |
---|---|
ArtifactContainer |
convertToContainer()
Attempt to convert this entry into a Container.
|
ArtifactContainer |
convertToContainer(boolean localOnly)
Attempt to convert this entry into a ArtifactContainer.
|
java.io.InputStream |
getInputStream()
Obtain inputstream for entry.
|
long |
getLastModified()
Obtain the time that this entry was last modified
|
java.net.URL |
getResource()
This method should return a URL suitable for the ServletContext.getResource(String path) method.
|
long |
getSize()
Obtain size of this Entries data, if any.
|
getEnclosingContainer, getPath, getPhysicalPath, getRoot
ArtifactContainer convertToContainer()
Returned container may be a new type of artifact, check ArtifactContainer.isRoot()
on the return.
ArtifactContainer convertToContainer(boolean localOnly)
Returned container may be a new type of artifact, check ArtifactContainer.isRoot()
on the return.
localOnly
- pass true if conversion should be restricted to returning Containers where isRoot returns false.java.io.InputStream getInputStream() throws java.io.IOException
java.io.IOException
- if there is supposed to be a stream, but an error occurred obtaining it.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)