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
DEFAULT_ROLE_HINT, ROLE
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 supplide resource into a "real" resource.
|
void |
setBaseDir(File baseDir) |
void |
setDefaultAttributes(int uid,
String userName,
int gid,
String groupName,
int fileMode,
int dirMode) |
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, setOverrideFileAttributes
getExcludes, getFileMappers, getFileSelectors, getIncludes, getLastModified, getName, getPrefix, getStreamTransformer, isCaseSensitive, isIncludingEmptyDirectories, isSelected, isUsingDefaultExcludes, iterator, setCaseSensitive, setExcludes, setFileMappers, setFileSelectors, setIncludes, setIncludingEmptyDirectories, setStreamTransformer, setUsingDefaultExcludes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public static final String ROLE_HINT
public PlexusIoResource resolve(PlexusIoResource resource) throws IOException
PlexusIoResourceCollection
resolve
in interface PlexusIoResourceCollection
resolve
in class AbstractPlexusIoResourceCollection
resource
- The resourcesIOException
- when something goes badpublic InputStream getInputStream(PlexusIoResource resource) throws IOException
PlexusIoResourceCollection
getInputStream
in interface PlexusIoResourceCollection
getInputStream
in class AbstractPlexusIoResourceCollection
resource
- The resourcesIOException
- when something goes badpublic String getName(PlexusIoResource resource)
PlexusIoResourceCollection
getName
in interface PlexusIoResourceCollection
getName
in class AbstractPlexusIoResourceCollection
resource
- 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)
AbstractPlexusIoResourceCollection
setPrefix
in class AbstractPlexusIoResourceCollection
public Stream stream()
PlexusIoResourceCollection
public Iterator<PlexusIoResource> getResources() throws IOException
PlexusIoResourceCollection
IOException
- .public boolean isConcurrentAccessSupported()
PlexusIoResourceCollection
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 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 false
Copyright © 2001–2018 Codehaus Plexus. All rights reserved.