org.codehaus.plexus.components.io.resources
Class AbstractPlexusIoResourceCollection

java.lang.Object
  extended by org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
All Implemented Interfaces:
PlexusIoResourceCollection, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
AbstractPlexusIoArchiveResourceCollection, PlexusIoFileResourceCollection, PlexusIoProxyResourceCollection

public abstract class AbstractPlexusIoResourceCollection
extends java.lang.Object
implements PlexusIoResourceCollection, org.codehaus.plexus.logging.LogEnabled

Default implementation of a resource collection.


Field Summary
 
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection
DEFAULT_ROLE_HINT, ROLE
 
Constructor Summary
protected AbstractPlexusIoResourceCollection()
           
protected AbstractPlexusIoResourceCollection(org.codehaus.plexus.logging.Logger logger)
           
 
Method Summary
 void enableLogging(org.codehaus.plexus.logging.Logger logger)
           
 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.
 long getLastModified()
          Returns the collections last modification time.
protected  org.codehaus.plexus.logging.Logger getLogger()
           
 java.lang.String getName(PlexusIoResource resource)
          Returns the resources suggested name.
 java.lang.String getPrefix()
          Returns the prefix, which the file sets contents shall have.
 boolean isCaseSensitive()
          Returns, whether the include/exclude patterns are case sensitive.
 boolean isIncludingEmptyDirectories()
          Returns, whether empty directories are being included.
protected  boolean isSelected(PlexusIoResource plexusIoResource)
           
 boolean isUsingDefaultExcludes()
          Returns, whether the default excludes are being applied.
 void setCaseSensitive(boolean caseSensitive)
          Sets, whether the include/exclude patterns are case sensitive.
 void setExcludes(java.lang.String[] excludes)
          Sets a string of patterns, which excluded files should match.
 void setFileMappers(FileMapper[] fileMappers)
          Sets the file name mappers, which are used to transform the resource names.
 void setFileSelectors(FileSelector[] fileSelectors)
          Sets a set of file selectors, which should be used to select the included files.
 void setIncludes(java.lang.String[] includes)
          Sets a string of patterns, which included files should match.
 void setIncludingEmptyDirectories(boolean includingEmptyDirectories)
          Sets, whether empty directories are being included.
 void setPrefix(java.lang.String prefix)
          Sets the prefix, which the file sets contents shall have.
 void setUsingDefaultExcludes(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
 

Constructor Detail

AbstractPlexusIoResourceCollection

protected AbstractPlexusIoResourceCollection()

AbstractPlexusIoResourceCollection

protected AbstractPlexusIoResourceCollection(org.codehaus.plexus.logging.Logger logger)
Method Detail

getLogger

protected org.codehaus.plexus.logging.Logger getLogger()

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.


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.


getName

public java.lang.String getName(PlexusIoResource resource)
                         throws java.io.IOException
Description copied from interface: PlexusIoResourceCollection
Returns the resources suggested name. This is used for integrating file mappers.

Specified by:
getName in interface PlexusIoResourceCollection
Parameters:
resource - A resource, which has been obtained by calling PlexusIoResourceCollection.getResources().
Throws:
java.io.IOException

getLastModified

public long getLastModified()
                     throws java.io.IOException
Description copied from interface: PlexusIoResourceCollection
Returns 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:
getLastModified in interface PlexusIoResourceCollection
Returns:
PlexusIoResource.UNKNOWN_MODIFICATION_DATE, if the collections last modification time is unknown, otherwise the last modification time in milliseconds.
Throws:
java.io.IOException

enableLogging

public void enableLogging(org.codehaus.plexus.logging.Logger logger)
Specified by:
enableLogging in interface org.codehaus.plexus.logging.LogEnabled


Copyright © 2001-2009 Codehaus. All Rights Reserved.