Class AbstractPlexusIoResourceCollection
- java.lang.Object
-
- org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
-
- All Implemented Interfaces:
java.lang.Iterable<PlexusIoResource>,PlexusIoResourceCollection
- Direct Known Subclasses:
AbstractPlexusIoArchiveResourceCollection,AbstractPlexusIoResourceCollectionWithAttributes
public abstract class AbstractPlexusIoResourceCollection extends java.lang.Object implements PlexusIoResourceCollection
Default implementation of a resource collection.
-
-
Field Summary
Fields Modifier and Type Field Description static InputStreamTransformeridentityTransformer
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPlexusIoResourceCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]getExcludes()Returns a string of patterns, which excluded files should match.FileMapper[]getFileMappers()Returns the file name mappers, which are used to transform the resource names.FileSelector[]getFileSelectors()Returns a set of file selectors, which should be used to select the included files.java.lang.String[]getIncludes()Returns a string of patterns, which included files should match.java.io.InputStreamgetInputStream(PlexusIoResource resource)Returns an input stream for the provided resource, with stream transformers appliedlonggetLastModified()Returns the collections last modification time.protected java.lang.StringgetName(java.lang.String resourceName)java.lang.StringgetName(PlexusIoResource resource)Returns the resources suggested name.java.lang.StringgetPrefix()Returns the prefix, which the file sets contents shall have.protected InputStreamTransformergetStreamTransformer()booleanisCaseSensitive()Returns, whether the include/exclude patterns are case sensitive.booleanisIncludingEmptyDirectories()Returns, whether empty directories are being included.protected booleanisSelected(PlexusIoResource plexusIoResource)booleanisUsingDefaultExcludes()Returns, whether the default excludes are being applied.java.util.Iterator<PlexusIoResource>iterator()PlexusIoResourceresolve(PlexusIoResource resource)Resolves the supplied resource into a "real" resource.voidsetCaseSensitive(boolean caseSensitive)Sets, whether the include/exclude patterns are case sensitive.voidsetExcludes(java.lang.String[] excludes)Sets a string of patterns, which excluded files should match.voidsetFileMappers(FileMapper[] fileMappers)Sets the file name mappers, which are used to transform the resource names.voidsetFileSelectors(FileSelector[] fileSelectors)Sets a set of file selectors, which should be used to select the included files.voidsetIncludes(java.lang.String[] includes)Sets a string of patterns, which included files should match.voidsetIncludingEmptyDirectories(boolean includingEmptyDirectories)Sets, whether empty directories are being included.voidsetPrefix(java.lang.String prefix)Sets the prefix, which the file sets contents shall have.voidsetStreamTransformer(InputStreamTransformer streamTransformer)voidsetUsingDefaultExcludes(boolean usingDefaultExcludes)Sets, whether the default excludes are being applied.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection
getResources, isConcurrentAccessSupported, stream
-
-
-
-
Field Detail
-
identityTransformer
public static final InputStreamTransformer identityTransformer
-
-
Method Detail
-
setExcludes
public void setExcludes(java.lang.String[] excludes)
Sets a string of patterns, which excluded files should match.
-
getExcludes
public java.lang.String[] getExcludes()
Returns a string of patterns, which excluded files should match.
-
setFileSelectors
public void setFileSelectors(FileSelector[] fileSelectors)
Sets a set of file selectors, which should be used to select the included files.
-
getFileSelectors
public FileSelector[] getFileSelectors()
Returns a set of file selectors, which should be used to select the included files.
-
setStreamTransformer
public void setStreamTransformer(InputStreamTransformer streamTransformer)
-
getStreamTransformer
protected InputStreamTransformer getStreamTransformer()
-
setIncludes
public void setIncludes(java.lang.String[] includes)
Sets a string of patterns, which included files should match.
-
getIncludes
public java.lang.String[] getIncludes()
Returns a string of patterns, which included files should match.
-
setPrefix
public void setPrefix(java.lang.String prefix)
Sets the prefix, which the file sets contents shall have.
-
getPrefix
public java.lang.String getPrefix()
Returns the prefix, which the file sets contents shall have.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
Sets, whether the include/exclude patterns are case sensitive. Defaults to true.
-
isCaseSensitive
public boolean isCaseSensitive()
Returns, whether the include/exclude patterns are case sensitive. Defaults to true.
-
setUsingDefaultExcludes
public void setUsingDefaultExcludes(boolean usingDefaultExcludes)
Sets, whether the default excludes are being applied. Defaults to true.
-
isUsingDefaultExcludes
public boolean isUsingDefaultExcludes()
Returns, whether the default excludes are being applied. Defaults to true.
-
setIncludingEmptyDirectories
public void setIncludingEmptyDirectories(boolean includingEmptyDirectories)
Sets, whether empty directories are being included. Defaults to true.
-
isIncludingEmptyDirectories
public boolean isIncludingEmptyDirectories()
Returns, whether empty directories are being included. Defaults to true.
-
isSelected
protected boolean isSelected(PlexusIoResource plexusIoResource) throws java.io.IOException
- Throws:
java.io.IOException
-
getFileMappers
public FileMapper[] getFileMappers()
Returns the file name mappers, which are used to transform the resource names.
-
setFileMappers
public void setFileMappers(FileMapper[] fileMappers)
Sets the file name mappers, which are used to transform the resource names.
-
iterator
public java.util.Iterator<PlexusIoResource> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<PlexusIoResource>
-
getName
public java.lang.String getName(PlexusIoResource resource)
Description copied from interface:PlexusIoResourceCollectionReturns the resources suggested name. This is used for integrating file mappers.- Specified by:
getNamein interfacePlexusIoResourceCollection- 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
-
getName
protected java.lang.String getName(java.lang.String resourceName)
-
getInputStream
public java.io.InputStream getInputStream(PlexusIoResource resource) throws java.io.IOException
Description copied from interface:PlexusIoResourceCollectionReturns an input stream for the provided resource, with stream transformers applied- Specified by:
getInputStreamin interfacePlexusIoResourceCollection- Parameters:
resource- The resources- Returns:
- A possibly transformed resource
- Throws:
java.io.IOException- when something goes bad
-
resolve
public PlexusIoResource resolve(PlexusIoResource resource) throws java.io.IOException
Description copied from interface:PlexusIoResourceCollectionResolves the supplied resource into a "real" resource. Resolving means applying input transformations Returns an input stream for the provided resource, with stream transformers applied- Specified by:
resolvein interfacePlexusIoResourceCollection- Parameters:
resource- The resources- Returns:
- A possibly transformed resource
- Throws:
java.io.IOException- when something goes bad
-
getLastModified
public long getLastModified() throws java.io.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- Returns:
PlexusIoResource.UNKNOWN_MODIFICATION_DATE, if the collections last modification time is unknown, otherwise the last modification time in milliseconds.- Throws:
java.io.IOException- .
-
-