Top Description Fields Constructors Methods
org.apache.tools.ant.taskdefs

public abstract Class Unpack

extends Task
Class Inheritance
Known Direct Subclasses
org.apache.tools.ant.taskdefs.BUnzip2, org.apache.tools.ant.taskdefs.GUnzip
Imports
java.io.File, org.apache.tools.ant.BuildException, .Task, org.apache.tools.ant.types.Resource, .ResourceCollection, org.apache.tools.ant.types.resources.FileProvider, .FileResource

Abstract Base class for unpack tasks.
Since
Ant 1.5

Field Summary

Modifier and TypeField and Description
protected File
protected File
protected Resource
Inherited from org.apache.tools.ant.Task:
targettaskNametaskTypewrapper

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addConfigured(ResourceCollection
the archive as a single element Resource collection.
a
)

Set the source Archive resource.

private void
createDestFile(String defaultExtension)

public void
execute()

Overrides org.apache.tools.ant.Task.execute.

Execute the task.
protected abstract void
extract()

Do the uncompressing.

protected abstract String

Returns:

the default extension.
getDefaultExtension
()

Get the extension.

private String
public void
setDest(String
a String value
dest
)

Deprecated since 1.5.x. setDest(String) is deprecated and is replaced with setDest(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
public void
setDest(File
destination file or directory
dest
)

The destination file or directory; optional.

public void
setSrc(String
a String value
src
)

Deprecated since 1.5.x. setSrc(String) is deprecated and is replaced with setSrc(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.
public void
setSrc(File
file to expand
src
)

The file to expand; required.

public void
setSrcResource(Resource
resource to expand
src
)

The resource to expand; required.

protected boolean

Returns:

false for this task.
supportsNonFileResources
()

Whether this task can deal with non-file resources.

private void
Inherited from org.apache.tools.ant.Task:
bindToOwnergetOwningTargetgetRuntimeConfigurableWrappergetTaskNamegetTaskTypegetWrapperhandleErrorFlushhandleErrorOutputhandleFlushhandleInputhandleOutputinitisInvalidloglogloglogmaybeConfigureperformreconfiguresetOwningTargetsetRuntimeConfigurableWrappersetTaskNamesetTaskType

Field Detail

destback to summary
protected File dest
sourceback to summary
protected File source
srcResourceback to summary
protected Resource srcResource

Constructor Detail

Unpackback to summary
public Unpack()

Method Detail

addConfiguredback to summary
public void addConfigured(ResourceCollection a)

Set the source Archive resource.

Parameters
a:ResourceCollection

the archive as a single element Resource collection.

createDestFileback to summary
private void createDestFile(String defaultExtension)
executeback to summary
public void execute() throws BuildException

Overrides org.apache.tools.ant.Task.execute.

Execute the task.

Annotations
@Override
Exceptions
BuildException:
on error
extractback to summary
protected abstract void extract()

Do the uncompressing. This is to be overridden by subclasses.

getDefaultExtensionback to summary
protected abstract String getDefaultExtension()

Get the extension. This is to be overridden by subclasses.

Returns:String

the default extension.

getLastNamePartback to summary
private String getLastNamePart(Resource r)
setDestback to summary
public void setDest(String dest)

Deprecated

since 1.5.x. setDest(String) is deprecated and is replaced with setDest(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.

Parameters
dest:String

a String value

Annotations
@Deprecated
setDestback to summary
public void setDest(File dest)

The destination file or directory; optional.

Parameters
dest:File

destination file or directory

setSrcback to summary
public void setSrc(String src)

Deprecated

since 1.5.x. setSrc(String) is deprecated and is replaced with setSrc(File) to make Ant's Introspection mechanism do the work and also to encapsulate operations on the type in its own class.

Parameters
src:String

a String value

Annotations
@Deprecated
setSrcback to summary
public void setSrc(File src)

The file to expand; required.

Parameters
src:File

file to expand

setSrcResourceback to summary
public void setSrcResource(Resource src)

The resource to expand; required.

Parameters
src:Resource

resource to expand

supportsNonFileResourcesback to summary
protected boolean supportsNonFileResources()

Whether this task can deal with non-file resources.

This implementation returns false.

Returns:boolean

false for this task.

Since
Ant 1.7
validateback to summary
private void validate() throws BuildException