protoj.lang.internal.ant
Class TarTask

java.lang.Object
  extended by protoj.lang.internal.ant.TarTask

public final class TarTask
extends java.lang.Object

A convenience class for creating compressed tar files. Use the constructors to specify the minimal and most widely anticipated configuration and the initXXX methods for the less common configuration options.

Tar files are created in gnu format which means arbitrary path lengths are supported. Therefore they must be untarred with the gtar tool.

Author:
Ashley Williams

Constructor Summary
TarTask(java.lang.String destDir, java.lang.String tarName)
          Creates a command that can generate tar files of the given name in the given directory.
 
Method Summary
 void addFileSet(java.io.File dir, java.lang.String prefix, java.lang.String fileMode, java.lang.String dirMode, java.lang.String userName, java.lang.String group, java.lang.String includes, java.lang.String excludes)
          Adds content to the tarfile with the specified properties.
 void execute()
           
 java.io.File getDestFile()
           
 org.apache.tools.ant.taskdefs.Tar getTar()
           
 java.lang.String getTarFilePath()
           
 java.lang.String getTarName()
           
 void initLogging(java.io.File logFile)
          Enables logging to the specified log file at Project.MSG_INFO level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarTask

public TarTask(java.lang.String destDir,
               java.lang.String tarName)
Creates a command that can generate tar files of the given name in the given directory. The generated file is compressed and given an extension of tar.gz. So the fully qualified path to the file is therefore destDir/tarName.tar.gz

Parameters:
destDir - where the tar file is to be created
tarName - the name of the tar file without the extension
Method Detail

addFileSet

public void addFileSet(java.io.File dir,
                       java.lang.String prefix,
                       java.lang.String fileMode,
                       java.lang.String dirMode,
                       java.lang.String userName,
                       java.lang.String group,
                       java.lang.String includes,
                       java.lang.String excludes)
Adds content to the tarfile with the specified properties. Consult the ant documentation for the meaning of the parameters.

Parameters:
dir -
prefix -
fileMode -
dirMode -
userName -
group -
includes -
excludes -

initLogging

public void initLogging(java.io.File logFile)
Enables logging to the specified log file at Project.MSG_INFO level.

Parameters:
logFile -

execute

public void execute()

getTarName

public java.lang.String getTarName()

getTarFilePath

public java.lang.String getTarFilePath()

getDestFile

public java.io.File getDestFile()

getTar

public org.apache.tools.ant.taskdefs.Tar getTar()