org.codehaus.plexus.archiver.tar
Class TarArchiver

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.codehaus.plexus.archiver.AbstractArchiver
          extended by org.codehaus.plexus.archiver.tar.TarArchiver
All Implemented Interfaces:
Archiver, FilterEnabled, FinalizerEnabled, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable

public class TarArchiver
extends AbstractArchiver

Version:
$Revision$ $Date$
Author:
Emmanuel Venisse

Nested Class Summary
static class TarArchiver.TarCompressionMethod
          Valid Modes for Compression attribute to Tar Task
 class TarArchiver.TarOptions
          Valid Modes for Compression attribute to Tar Task
 
Field Summary
 
Fields inherited from interface org.codehaus.plexus.archiver.Archiver
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE, DUPLICATES_ADD, DUPLICATES_FAIL, DUPLICATES_PRESERVE, DUPLICATES_SKIP, DUPLICATES_VALID_BEHAVIORS, ROLE
 
Constructor Summary
TarArchiver()
           
 
Method Summary
protected  void cleanUp()
           
protected  void close()
           
protected  void execute()
           
protected  String getArchiveType()
           
 TarArchiver.TarOptions getOptions()
           
 boolean isSupportingForced()
          Returns, whether the archive supports uptodate checks.
 void setCompression(TarArchiver.TarCompressionMethod mode)
          Set compression method.
 void setLongfile(TarLongFileMode mode)
          Set how to handle long files, those with a path>100 chars.
 void setOptions(TarArchiver.TarOptions options)
          Set all tar options
protected  void tarFile(ArchiveEntry entry, TarOutputStream tOut, String vPath)
          tar a file
 
Methods inherited from class org.codehaus.plexus.archiver.AbstractArchiver
addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchivedFileSet, addArchiveFinalizer, addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, addFileSet, addResource, addResources, asArchiveEntry, asArchiveEntry, asResourceCollection, checkForced, contextualize, createArchive, getArchiveFinalizers, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirectoryMode, getDirs, getDuplicateBehavior, getFileMode, getFiles, getIncludeEmptyDirs, getLogger, getOverrideDirectoryMode, getOverrideFileMode, getRawDefaultDirectoryMode, getRawDefaultFileMode, getResources, hasVirtualFiles, isForced, isIgnorePermissions, isUptodate, isUseJvmChmod, revert, runArchiveFinalizers, setArchiveFilters, setArchiveFinalizers, setDefaultDirectoryMode, setDefaultFileMode, setDestFile, setDirectoryMode, setDotFileDirectory, setDuplicateBehavior, setFileMode, setForced, setIgnorePermissions, setIncludeEmptyDirs, setUseJvmChmod, validate
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarArchiver

public TarArchiver()
Method Detail

getOptions

public TarArchiver.TarOptions getOptions()

setOptions

public void setOptions(TarArchiver.TarOptions options)
Set all tar options

Parameters:
options - options

setLongfile

public void setLongfile(TarLongFileMode mode)
Set how to handle long files, those with a path>100 chars. Optional, default=warn.

Allowable values are

Parameters:
mode - the mode to handle long file names.

setCompression

public void setCompression(TarArchiver.TarCompressionMethod mode)
Set compression method. Allowable values are

Parameters:
mode - the compression method.

execute

protected void execute()
                throws ArchiverException,
                       IOException
Specified by:
execute in class AbstractArchiver
Throws:
ArchiverException
IOException

tarFile

protected void tarFile(ArchiveEntry entry,
                       TarOutputStream tOut,
                       String vPath)
                throws ArchiverException,
                       IOException
tar a file

Parameters:
entry - the file to tar
tOut - the output stream
vPath - the path name of the file to tar
Throws:
IOException - on error
ArchiverException

isSupportingForced

public boolean isSupportingForced()
Description copied from interface: Archiver
Returns, whether the archive supports uptodate checks. If so, you may set Archiver.setForced(boolean) to true.

Specified by:
isSupportingForced in interface Archiver
Overrides:
isSupportingForced in class AbstractArchiver
Returns:
True, if the archiver does support uptodate checks, false otherwise
See Also:
Archiver.setForced(boolean), Archiver.isForced()

cleanUp

protected void cleanUp()
Overrides:
cleanUp in class AbstractArchiver

close

protected void close()
              throws IOException
Specified by:
close in class AbstractArchiver
Throws:
IOException

getArchiveType

protected String getArchiveType()
Specified by:
getArchiveType in class AbstractArchiver


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.