org.apache.tools.ant.types.resources

Class TarResource

Implemented Interfaces:
Cloneable, Comparable, ResourceCollection

public class TarResource
extends ArchiveResource

A Resource representation of an entry in a tar archive.
Since:
Ant 1.7

Field Summary

Fields inherited from class org.apache.tools.ant.types.Resource

MAGIC, UNKNOWN_DATETIME, UNKNOWN_SIZE

Fields inherited from class org.apache.tools.ant.types.DataType

checked, ref

Fields inherited from class org.apache.tools.ant.ProjectComponent

description, location, project

Constructor Summary

TarResource()
Default constructor.
TarResource(File a, TarEntry e)
Construct a TarResource representing the specified entry in the specified archive.
TarResource(Resource a, TarEntry e)
Construct a TarResource representing the specified entry in the specified archive.

Method Summary

protected void
fetchEntry()
fetches information from the named entry inside the archive.
int
getGid()
String
getGroup()
InputStream
getInputStream()
Return an InputStream for reading the contents of this Resource.
OutputStream
getOutputStream()
Get an OutputStream for the Resource.
int
getUid()
String
getUserName()

Methods inherited from class org.apache.tools.ant.types.resources.ArchiveResource

addConfigured, compareTo, equals, fetchEntry, getArchive, getLastModified, getMode, getSize, hashCode, isDirectory, isExists, setArchive, setMode, setRefid, toString

Methods inherited from class org.apache.tools.ant.types.Resource

clone, compareTo, equals, getInputStream, getLastModified, getMagicNumber, getName, getOutputStream, getSize, hashCode, isDirectory, isExists, isFilesystemOnly, iterator, setDirectory, setExists, setLastModified, setName, setRefid, setSize, size, toLongString, toString

Methods inherited from class org.apache.tools.ant.types.DataType

checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes

Methods inherited from class org.apache.tools.ant.ProjectComponent

clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject

Constructor Details

TarResource

public TarResource()
Default constructor.

TarResource

public TarResource(File a,
                   TarEntry e)
Construct a TarResource representing the specified entry in the specified archive.
Parameters:
a - the archive as File.
e - the TarEntry.

TarResource

public TarResource(Resource a,
                   TarEntry e)
Construct a TarResource representing the specified entry in the specified archive.
Parameters:
a - the archive as Resource.
e - the TarEntry.

Method Details

fetchEntry

protected void fetchEntry()
fetches information from the named entry inside the archive.
Overrides:
fetchEntry in interface ArchiveResource

getGid

public int getGid()
Returns:
the uid for the tar entry

getGroup

public String getGroup()
Returns:
the group name for the tar entry

getInputStream

public InputStream getInputStream()
            throws IOException
Return an InputStream for reading the contents of this Resource.
Overrides:
getInputStream in interface Resource
Returns:
an InputStream object.

getOutputStream

public OutputStream getOutputStream()
            throws IOException
Get an OutputStream for the Resource.
Overrides:
getOutputStream in interface Resource
Returns:
an OutputStream to which content can be written.

getUid

public int getUid()
Returns:
the uid for the tar entry

getUserName

public String getUserName()
Returns:
the user name for the tar entry