<tar>

Purpose/Function

Create a tape archive (tar) file from the given inputs. Wraps the UNIX shell command.

Attributes

NAME

TYPE

DEFAULT VALUE

DESCRIPTION

tarPath

java.io.File

required

path of the tar file to create

tarBaseDir

java.io.File

null

directory in which to execute the command (defaults to user dir)

sourceExpression

java.lang.String

required if there are no paths

a Unix-like path expression (must be relative to base)

paths

java.util.List

required if no path expression set

list of path strings (can be file URIs or paths)

verbose

boolean

false

add "v" to the command

zip

boolean

false

add "z" to the command

altShellPaths

java.util.List

null

additional places to look for the shell executable on this host (defaults are /bin/sh and /usr/bin/sh)

Elements

TAG

TYPE

COUNT

DESCRIPTION

path

java.lang.String

0:N

a path to add to the path list

altShellPath

java.lang.String

0:N

a path to add to the alternate shell path list

ReturnValues

None.

Examples

...
<declare name="uriList">
    <list>
       <value>file:/tmp/source/a.txt</value>
       <value>file:/tmp/source/b.txt</value>
       <value>file:/tmp/source/c.txt</value>
    </list>
</declare>

<tar tarPath="/tmp/ogre.tar.gz" tarBaseDir="/tmp/arossi" sourceExpression="*" zip="true"/>
<tar tarPath="/tmp/ogre2.tar.gz" tarBaseDir="/tmp/source">
   <path>a.txt</path>
   <path>b.txt</path>
   <path>c.txt</path>
</tar>

<!-- NOTE: be careful here ... -->
<tar tarPath="/tmp/ogre3.tar.gz" paths="${uriList}/>
...
NOTE

The paths of the referenced source URIs given in the third example will be ignored (only the names of the files will added to the list); hence, this task will be looking for the three named files in the user's current directory, which is probably a mistake; what the user more than likely should do here is set tarBaseDir to "/tmp/source", as in the second example.)

  • No labels