Class AbstractPlexusIoResourceCollection

java.lang.Object
org.codehaus.plexus.components.io.resources.AbstractPlexusIoResourceCollection
All Implemented Interfaces:
Iterable<PlexusIoResource>, PlexusIoResourceCollection
Direct Known Subclasses:
AbstractPlexusIoArchiveResourceCollection, AbstractPlexusIoResourceCollectionWithAttributes

public abstract class AbstractPlexusIoResourceCollection extends Object implements PlexusIoResourceCollection
Default implementation of a resource collection.
  • Field Details Link icon

  • Constructor Details Link icon

    • AbstractPlexusIoResourceCollection Link icon

      protected AbstractPlexusIoResourceCollection()
  • Method Details Link icon

    • setExcludes Link icon

      public void setExcludes(String[] excludes)
      Sets a string of patterns, which excluded files should match.
    • getExcludes Link icon

      public String[] getExcludes()
      Returns a string of patterns, which excluded files should match.
    • setFileSelectors Link icon

      public void setFileSelectors(FileSelector[] fileSelectors)
      Sets a set of file selectors, which should be used to select the included files.
    • getFileSelectors Link icon

      public FileSelector[] getFileSelectors()
      Returns a set of file selectors, which should be used to select the included files.
    • setStreamTransformer Link icon

      public void setStreamTransformer(InputStreamTransformer streamTransformer)
    • getStreamTransformer Link icon

      protected InputStreamTransformer getStreamTransformer()
    • setIncludes Link icon

      public void setIncludes(String[] includes)
      Sets a string of patterns, which included files should match.
    • getIncludes Link icon

      public String[] getIncludes()
      Returns a string of patterns, which included files should match.
    • setPrefix Link icon

      public void setPrefix(String prefix)
      Sets the prefix, which the file sets contents shall have.
    • getPrefix Link icon

      public String getPrefix()
      Returns the prefix, which the file sets contents shall have.
    • setCaseSensitive Link icon

      public void setCaseSensitive(boolean caseSensitive)
      Sets, whether the include/exclude patterns are case sensitive. Defaults to true.
    • isCaseSensitive Link icon

      public boolean isCaseSensitive()
      Returns, whether the include/exclude patterns are case sensitive. Defaults to true.
    • setUsingDefaultExcludes Link icon

      public void setUsingDefaultExcludes(boolean usingDefaultExcludes)
      Sets, whether the default excludes are being applied. Defaults to true.
    • isUsingDefaultExcludes Link icon

      public boolean isUsingDefaultExcludes()
      Returns, whether the default excludes are being applied. Defaults to true.
    • setIncludingEmptyDirectories Link icon

      public void setIncludingEmptyDirectories(boolean includingEmptyDirectories)
      Sets, whether empty directories are being included. Defaults to true.
    • isIncludingEmptyDirectories Link icon

      public boolean isIncludingEmptyDirectories()
      Returns, whether empty directories are being included. Defaults to true.
    • isSelected Link icon

      protected boolean isSelected(PlexusIoResource plexusIoResource) throws IOException
      Throws:
      IOException
    • getFileMappers Link icon

      public FileMapper[] getFileMappers()
      Returns the file name mappers, which are used to transform the resource names.
    • setFileMappers Link icon

      public void setFileMappers(FileMapper[] fileMappers)
      Sets the file name mappers, which are used to transform the resource names.
    • iterator Link icon

      public Iterator<PlexusIoResource> iterator()
      Specified by:
      iterator in interface Iterable<PlexusIoResource>
    • getName Link icon

      public String getName(PlexusIoResource resource)
      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().
      Returns:
      The resource name. If it is a file, it should be normalized to platform separators
    • getName Link icon

      protected String getName(String resourceName)
    • getInputStream Link icon

      public InputStream getInputStream(PlexusIoResource resource) throws IOException
      Description copied from interface: PlexusIoResourceCollection
      Returns an input stream for the provided resource, with stream transformers applied
      Specified by:
      getInputStream in interface PlexusIoResourceCollection
      Parameters:
      resource - The resources
      Returns:
      A possibly transformed resource
      Throws:
      IOException - when something goes bad
    • resolve Link icon

      public PlexusIoResource resolve(PlexusIoResource resource) throws IOException
      Description copied from interface: PlexusIoResourceCollection
      Resolves 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:
      resolve in interface PlexusIoResourceCollection
      Parameters:
      resource - The resources
      Returns:
      A possibly transformed resource
      Throws:
      IOException - when something goes bad
    • getLastModified Link icon

      public long getLastModified() throws 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:
      IOException - .