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

java.lang.Object
  extended by org.codehaus.plexus.components.io.resources.PlexusIoCompressedFileResourceCollection
All Implemented Interfaces:
PlexusIoArchivedResourceCollection, PlexusIoResourceCollection

public abstract class PlexusIoCompressedFileResourceCollection
extends java.lang.Object
implements PlexusIoArchivedResourceCollection

Abstract base class for compressed files, aka singleton resource collections.


Field Summary
 
Fields inherited from interface org.codehaus.plexus.components.io.resources.PlexusIoResourceCollection
DEFAULT_ROLE_HINT, ROLE
 
Constructor Summary
PlexusIoCompressedFileResourceCollection()
           
 
Method Summary
protected abstract  java.lang.String getDefaultExtension()
           
 java.io.File getFile()
          Returns the archive file
protected abstract  java.io.InputStream getInputStream(java.io.File file)
           
 long getLastModified()
          Returns the collections last modification time.
protected  java.lang.String getName(java.io.File file)
           
 java.lang.String getName(PlexusIoResource resource)
          Returns the resources suggested name.
 java.lang.String getPath()
           
 java.util.Iterator<PlexusIoResource> getResources()
          Returns an iterator over the resources in the collection.
 void setFile(java.io.File file)
          Sets the arcihve file
 void setPath(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlexusIoCompressedFileResourceCollection

public PlexusIoCompressedFileResourceCollection()
Method Detail

getFile

public java.io.File getFile()
Description copied from interface: PlexusIoArchivedResourceCollection
Returns the archive file

Specified by:
getFile in interface PlexusIoArchivedResourceCollection

setFile

public void setFile(java.io.File file)
Description copied from interface: PlexusIoArchivedResourceCollection
Sets the arcihve file

Specified by:
setFile in interface PlexusIoArchivedResourceCollection

getPath

public java.lang.String getPath()

setPath

public void setPath(java.lang.String path)

getResources

public java.util.Iterator<PlexusIoResource> getResources()
                                                  throws java.io.IOException
Description copied from interface: PlexusIoResourceCollection
Returns an iterator over the resources in the collection.

Specified by:
getResources in interface PlexusIoResourceCollection
Returns:
An iterator
Throws:
java.io.IOException - .

getName

protected java.lang.String getName(java.io.File file)
                            throws java.io.IOException
Throws:
java.io.IOException

getDefaultExtension

protected abstract java.lang.String getDefaultExtension()

getInputStream

protected abstract java.io.InputStream getInputStream(java.io.File file)
                                               throws java.io.IOException
Throws:
java.io.IOException

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().
Returns:
The resource name
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 - .


Copyright © 2001-2011 Codehaus. All Rights Reserved.