public abstract class PlexusIoCompressedFileResourceCollection extends Object implements PlexusIoArchivedResourceCollection, Iterable<PlexusIoResource>
DEFAULT_ROLE_HINT, ROLE| Constructor and Description |
|---|
PlexusIoCompressedFileResourceCollection() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract PlexusIoResourceAttributes |
getAttributes(File f) |
protected abstract String |
getDefaultExtension() |
File |
getFile()
Returns the archive file
|
protected abstract InputStream |
getInputStream(File file) |
InputStream |
getInputStream(PlexusIoResource resource)
Returns an input stream for the provided resource, with stream transformers applied
|
long |
getLastModified()
Returns the collections last modification time.
|
protected String |
getName(File file) |
String |
getName(PlexusIoResource resource)
Returns the resources suggested name.
|
String |
getPath() |
Iterator<PlexusIoResource> |
getResources()
Returns an iterator over the resources in the collection.
|
boolean |
isConcurrentAccessSupported()
Indicates if this collection supports concurrent access to its resources.
|
Iterator<PlexusIoResource> |
iterator() |
PlexusIoResource |
resolve(PlexusIoResource resource)
Resolves the supplide resource into a "real" resource.
|
void |
setFile(File file)
Sets the arcihve file
|
void |
setPath(String path) |
void |
setStreamTransformer(InputStreamTransformer streamTransformers) |
Stream |
stream()
Returns the resources as a stream.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic PlexusIoCompressedFileResourceCollection()
public File getFile()
PlexusIoArchivedResourceCollectiongetFile in interface PlexusIoArchivedResourceCollectionpublic void setFile(File file)
PlexusIoArchivedResourceCollectionsetFile in interface PlexusIoArchivedResourceCollectionpublic String getPath()
public void setPath(String path)
protected abstract PlexusIoResourceAttributes getAttributes(File f) throws IOException
IOExceptionpublic void setStreamTransformer(InputStreamTransformer streamTransformers)
public Stream stream()
PlexusIoResourceCollectionstream in interface PlexusIoResourceCollectionpublic Iterator<PlexusIoResource> getResources() throws IOException
PlexusIoResourceCollectiongetResources in interface PlexusIoResourceCollectionIOException - .protected String getName(File file) throws IOException
IOExceptionprotected abstract String getDefaultExtension()
@Nonnull protected abstract InputStream getInputStream(File file) throws IOException
IOExceptionpublic InputStream getInputStream(PlexusIoResource resource) throws IOException
PlexusIoResourceCollectiongetInputStream in interface PlexusIoResourceCollectionresource - The resourcesIOException - when something goes badpublic PlexusIoResource resolve(PlexusIoResource resource) throws IOException
PlexusIoResourceCollectionresolve in interface PlexusIoResourceCollectionresource - The resourcesIOException - when something goes badpublic Iterator<PlexusIoResource> iterator()
iterator in interface Iterable<PlexusIoResource>public String getName(PlexusIoResource resource)
PlexusIoResourceCollectiongetName in interface PlexusIoResourceCollectionresource - A resource, which has been obtained by
calling PlexusIoResourceCollection.getResources().public long getLastModified()
throws IOException
PlexusIoResourceCollectiongetLastModified in interface PlexusIoResourceCollectionPlexusIoResource.UNKNOWN_MODIFICATION_DATE,
if the collections last modification time is unknown,
otherwise the last modification time in milliseconds.IOException - .public boolean isConcurrentAccessSupported()
PlexusIoResourceCollectionSome resource collections (like tar files) may not support efficient random access
or seek operation so implementations that represent such collections may not be able
to provide concurrent access to its resources. If implementation returns false,
then it is not safe to access its methods and resources in concurrent fashion.
For example it is not safe to read from two resources in two concurrent threads,
to read a resource and iterate over the iterator returned by PlexusIoResourceCollection.getResources()
in two concurrent threads, etc.
Please note that this method indicates concurrent support only for the collection,
not for the individual resources. This means there is no guarantee that
the resources returned by PlexusIoResourceCollection.resolve(PlexusIoResource) or the input stream
returned by PlexusIoResourceCollection.getInputStream(PlexusIoResource) are thread-safe,
even if true is returned.
isConcurrentAccessSupported in interface PlexusIoResourceCollectiontrue if this collection supports concurrent access,
otherwise falseCopyright © 2001–2017 Codehaus Plexus. All rights reserved.