@Named(value="files") public class PlexusIoFileResourceCollection extends AbstractPlexusIoResourceCollectionWithAttributes
PlexusIoResourceCollection for the set
of files in a common directory.| Modifier and Type | Field and Description |
|---|---|
static String |
ROLE_HINT
Role hint of this component
|
identityTransformer| Constructor and Description |
|---|
PlexusIoFileResourceCollection() |
| Modifier and Type | Method and Description |
|---|---|
File |
getBaseDir() |
InputStream |
getInputStream(PlexusIoResource resource)
Returns an input stream for the provided resource, with stream transformers applied
|
String |
getName(PlexusIoResource resource)
Returns the resources suggested name.
|
Iterator<PlexusIoResource> |
getResources()
Returns an iterator over the resources in the collection.
|
boolean |
isConcurrentAccessSupported()
Indicates if this collection supports concurrent access to its resources.
|
boolean |
isFollowingSymLinks() |
PlexusIoResource |
resolve(PlexusIoResource resource)
Resolves the supplied resource into a "real" resource.
|
void |
setBaseDir(File baseDir) |
void |
setDefaultAttributes(int uid,
String userName,
int gid,
String groupName,
int fileMode,
int dirMode) |
void |
setFilenameComparator(Comparator<String> filenameComparator) |
void |
setFollowingSymLinks(boolean pIsFollowingSymLinks) |
void |
setOverrideAttributes(int uid,
String userName,
int gid,
String groupName,
int fileMode,
int dirMode) |
void |
setPrefix(String prefix)
Sets the prefix, which the file sets contents shall
have.
|
Stream |
stream()
Returns the resources as a stream.
|
getDefaultDirAttributes, getDefaultFileAttributes, getOverrideDirAttributes, getOverrideFileAttributes, mergeAttributes, setDefaultDirAttributes, setDefaultFileAttributes, setOverrideDirAttributes, setOverrideFileAttributesgetExcludes, getFileMappers, getFileSelectors, getIncludes, getLastModified, getName, getPrefix, getStreamTransformer, isCaseSensitive, isIncludingEmptyDirectories, isSelected, isUsingDefaultExcludes, iterator, setCaseSensitive, setExcludes, setFileMappers, setFileSelectors, setIncludes, setIncludingEmptyDirectories, setStreamTransformer, setUsingDefaultExcludesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic static final String ROLE_HINT
public PlexusIoResource resolve(PlexusIoResource resource) throws IOException
PlexusIoResourceCollectionresolve in interface PlexusIoResourceCollectionresolve in class AbstractPlexusIoResourceCollectionresource - The resourcesIOException - when something goes badpublic InputStream getInputStream(PlexusIoResource resource) throws IOException
PlexusIoResourceCollectiongetInputStream in interface PlexusIoResourceCollectiongetInputStream in class AbstractPlexusIoResourceCollectionresource - The resourcesIOException - when something goes badpublic String getName(PlexusIoResource resource)
PlexusIoResourceCollectiongetName in interface PlexusIoResourceCollectiongetName in class AbstractPlexusIoResourceCollectionresource - A resource, which has been obtained by
calling PlexusIoResourceCollection.getResources().public void setBaseDir(File baseDir)
baseDir - The base directory of the file collectionpublic File getBaseDir()
public boolean isFollowingSymLinks()
public void setFollowingSymLinks(boolean pIsFollowingSymLinks)
pIsFollowingSymLinks - whether symbolic links should be followedpublic void setDefaultAttributes(int uid,
String userName,
int gid,
String groupName,
int fileMode,
int dirMode)
public void setOverrideAttributes(int uid,
String userName,
int gid,
String groupName,
int fileMode,
int dirMode)
public void setPrefix(String prefix)
AbstractPlexusIoResourceCollectionsetPrefix in class AbstractPlexusIoResourceCollectionpublic Stream stream()
PlexusIoResourceCollectionpublic Iterator<PlexusIoResource> getResources() throws IOException
PlexusIoResourceCollectionIOException - .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.
true if this collection supports concurrent access,
otherwise falsepublic void setFilenameComparator(Comparator<String> filenameComparator)
Copyright © 2001–2023 Codehaus Plexus. All rights reserved.