Class PlexusIoProxyResourceCollection
- java.lang.Object
-
- org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
-
- org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollectionWithAttributes
-
- org.codehaus.plexus.components.io.resources.proxy.PlexusIoProxyResourceCollection
-
- All Implemented Interfaces:
Iterable<PlexusIoResource>,EncodingSupported,PlexusIoResourceCollection
public class PlexusIoProxyResourceCollection extends AbstractPlexusIoResourceCollectionWithAttributes implements EncodingSupported
Implementation ofPlexusIoResourceCollectionfor an archives contents.
-
-
Field Summary
-
Fields inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
identityTransformer
-
-
Constructor Summary
Constructors Constructor Description PlexusIoProxyResourceCollection(PlexusIoResourceCollection src)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FileSelectorgetDefaultFileSelector()longgetLastModified()Returns the collections last modification time.StringgetName(PlexusIoResource resource)Returns the resources suggested name.Iterator<PlexusIoResource>getResources()Returns an iterator over the resources in the collection.PlexusIoResourceCollectiongetSrc()Returns the archive to read.booleanisConcurrentAccessSupported()Indicates if this collection supports concurrent access to its resources.voidsetDefaultAttributes(int uid, String userName, int gid, String groupName, int fileMode, int dirMode)voidsetEncoding(Charset charset)Supplies the encoding to be used for decoding filenames/pathsvoidsetOverrideAttributes(int uid, String userName, int gid, String groupName, int fileMode, int dirMode)voidsetStreamTransformer(InputStreamTransformer streamTransformer)Streamstream()Returns the resources as a stream.-
Methods inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollectionWithAttributes
getDefaultDirAttributes, getDefaultFileAttributes, getOverrideDirAttributes, getOverrideFileAttributes, mergeAttributes, setDefaultDirAttributes, setDefaultFileAttributes, setOverrideDirAttributes, setOverrideFileAttributes
-
Methods inherited from class org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
getExcludes, getFileMappers, getFileSelectors, getIncludes, getInputStream, getName, getPrefix, getStreamTransformer, isCaseSensitive, isIncludingEmptyDirectories, isSelected, isUsingDefaultExcludes, iterator, resolve, setCaseSensitive, setExcludes, setFileMappers, setFileSelectors, setIncludes, setIncludingEmptyDirectories, setPrefix, setUsingDefaultExcludes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
PlexusIoProxyResourceCollection
public PlexusIoProxyResourceCollection(@Nonnull PlexusIoResourceCollection src)
-
-
Method Detail
-
getSrc
public PlexusIoResourceCollection getSrc()
Returns the archive to read.
-
setDefaultAttributes
public void setDefaultAttributes(int uid, String userName, int gid, String groupName, int fileMode, int dirMode)
-
setOverrideAttributes
public void setOverrideAttributes(int uid, String userName, int gid, String groupName, int fileMode, int dirMode)
-
setStreamTransformer
public void setStreamTransformer(InputStreamTransformer streamTransformer)
- Overrides:
setStreamTransformerin classAbstractPlexusIoResourceCollection
-
getDefaultFileSelector
protected FileSelector getDefaultFileSelector()
-
stream
public Stream stream()
Description copied from interface:PlexusIoResourceCollectionReturns the resources as a stream.- Specified by:
streamin interfacePlexusIoResourceCollection- Returns:
- A stream for functional iteration
-
getResources
public Iterator<PlexusIoResource> getResources() throws IOException
Description copied from interface:PlexusIoResourceCollectionReturns an iterator over the resources in the collection.- Specified by:
getResourcesin interfacePlexusIoResourceCollection- Returns:
- An iterator
- Throws:
IOException- .
-
getName
public String getName(PlexusIoResource resource)
Description copied from interface:PlexusIoResourceCollectionReturns the resources suggested name. This is used for integrating file mappers.- Specified by:
getNamein interfacePlexusIoResourceCollection- Overrides:
getNamein classAbstractPlexusIoResourceCollection- Parameters:
resource- A resource, which has been obtained by callingPlexusIoResourceCollection.getResources().- Returns:
- The resource name. If it is a file, it should be normalized to platform separators
-
getLastModified
public long getLastModified() throws IOExceptionDescription copied from interface:PlexusIoResourceCollectionReturns the collections last modification time. For a collection of files, this might be the last modification time of the file, which has been modified at last. For an archive file, this might be the modification time of the archive file.- Specified by:
getLastModifiedin interfacePlexusIoResourceCollection- Overrides:
getLastModifiedin classAbstractPlexusIoResourceCollection- Returns:
PlexusIoResource.UNKNOWN_MODIFICATION_DATE, if the collections last modification time is unknown, otherwise the last modification time in milliseconds.- Throws:
IOException- .
-
setEncoding
public void setEncoding(Charset charset)
Description copied from interface:EncodingSupportedSupplies the encoding to be used for decoding filenames/paths- Specified by:
setEncodingin interfaceEncodingSupported- Parameters:
charset- The charset to use
-
isConcurrentAccessSupported
public boolean isConcurrentAccessSupported()
Description copied from interface:PlexusIoResourceCollectionIndicates if this collection supports concurrent access to its resources.Some 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 byPlexusIoResourceCollection.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 byPlexusIoResourceCollection.getInputStream(PlexusIoResource)are thread-safe, even iftrueis returned.- Specified by:
isConcurrentAccessSupportedin interfacePlexusIoResourceCollection- Returns:
trueif this collection supports concurrent access, otherwisefalse
-
-