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, org.codehaus.plexus.logging.LogEnabled

public class TarArchiver
extends AbstractArchiver

Version:
$Revision: 2436 $ $Date: 2005-09-01 10:20:41 -0700 (Thu, 01 Sep 2005) $
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 class org.codehaus.plexus.archiver.AbstractArchiver
DEFAULT_DIR_MODE, DEFAULT_FILE_MODE
 
Fields inherited from interface org.codehaus.plexus.archiver.Archiver
ROLE
 
Constructor Summary
TarArchiver()
           
 
Method Summary
 void createArchive()
           
 TarArchiver.TarOptions getOptions()
           
 void setCompression(TarArchiver.TarCompressionMethod mode)
          Set compression method.
 void setDefaultDirectoryMode(int mode)
          Override AbstractArchiver.setDefaultDirectoryMode to update TarOptions.
 void setDefaultFileMode(int mode)
          Override AbstractArchiver.setDefaultFileMode to update TarOptions.
 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, java.lang.String vPath)
          tar a file
 
Methods inherited from class org.codehaus.plexus.archiver.AbstractArchiver
addDirectory, addDirectory, addDirectory, addDirectory, addFile, addFile, getDefaultDirectoryMode, getDefaultFileMode, getDestFile, getDirs, getFiles, getIncludeEmptyDirs, getLogger, setDestFile, setIncludeEmptyDirs
 
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

setDefaultFileMode

public void setDefaultFileMode(int mode)
Override AbstractArchiver.setDefaultFileMode to update TarOptions.

Specified by:
setDefaultFileMode in interface Archiver
Overrides:
setDefaultFileMode in class AbstractArchiver

setDefaultDirectoryMode

public void setDefaultDirectoryMode(int mode)
Override AbstractArchiver.setDefaultDirectoryMode to update TarOptions.

Specified by:
setDefaultDirectoryMode in interface Archiver
Overrides:
setDefaultDirectoryMode in class AbstractArchiver

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.

createArchive

public void createArchive()
                   throws ArchiverException,
                          java.io.IOException
Throws:
ArchiverException
java.io.IOException

tarFile

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

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


Copyright 2001-2001-2006 Codehaus. All Rights Reserved.