org.apache.tools.ant.types.resources

Class TarResource

public class TarResource extends ArchiveResource

A Resource representation of an entry in a tar archive.

Since: Ant 1.7

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 voidfetchEntry()
fetches information from the named entry inside the archive.
intgetGid()
StringgetGroup()
InputStreamgetInputStream()
Return an InputStream for reading the contents of this Resource.
OutputStreamgetOutputStream()
Get an OutputStream for the Resource.
intgetUid()
StringgetUserName()

Constructor Detail

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 Detail

fetchEntry

protected void fetchEntry()
fetches information from the named entry inside the archive.

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()
Return an InputStream for reading the contents of this Resource.

Returns: an InputStream object.

Throws: IOException if the tar file cannot be opened, or the entry cannot be read.

getOutputStream

public OutputStream getOutputStream()
Get an OutputStream for the Resource.

Returns: an OutputStream to which content can be written.

Throws: IOException if unable to provide the content of this Resource as a stream. UnsupportedOperationException if OutputStreams are not supported for this Resource type.

getUid

public int getUid()

Returns: the uid for the tar entry

getUserName

public String getUserName()

Returns: the user name for the tar entry