Remote Systems
v6.4.1

com.ibm.etools.systems.core.clientserver.util.tar
Class TarFile

java.lang.Object
  extended bycom.ibm.etools.systems.core.clientserver.util.tar.TarFile
All Implemented Interfaces:
ITarConstants

public class TarFile
extends Object
implements ITarConstants

This class is used to read entries from a tar file.


Field Summary
 
Fields inherited from interface com.ibm.etools.systems.core.clientserver.util.tar.ITarConstants
BLOCK_SIZE, CHKSUM_LENGTH, DEVMAJOR_LENGTH, DEVMINOR_LENGTH, GID_LENGTH, GNAME_LENGTH, HEADER_LENGTH, LINKNAME_LENGTH, MAGIC_LENGTH, MODE_LENGTH, MTIME_LENGTH, NAME_LENGTH, PREFIX_LENGTH, SEPARATOR_CHAR, SIZE_LENGTH, TF_BLOCK, TF_CHAR, TF_CONTIGUOUS, TF_DIR, TF_FIFO, TF_LINK, TF_NORMAL, TF_OLDNORMAL, TF_SYMLINK, TYPEFLAG_LENGTH, UID_LENGTH, UNAME_LENGTH, VERSION_LENGTH
 
Constructor Summary
TarFile(File file)
          Opens a tar file for reading given the specified File object.
TarFile(String name)
          Opens a tar file for reading given the file name.
 
Method Summary
 Enumeration entries()
          Returns an enumeration of the tar file entries.
 TarEntry getEntry(String name)
          Returns the tar file entry with that name, or null if not found.
 InputStream getInputStream(TarEntry entry)
          Returns the input stream of the data in the given entry.
 int size()
          Returns the number of entries in the tar file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarFile

public TarFile(File file)
        throws FileNotFoundException,
               IOException
Opens a tar file for reading given the specified File object.

Parameters:
file - the tar file to be opened for reading.
Throws:
FileNotFoundException - if the file does not exist.
IOException - if an I/O error occurs.

TarFile

public TarFile(String name)
        throws FileNotFoundException,
               IOException
Opens a tar file for reading given the file name.

Parameters:
name - the name of the tar file to be opened for reading.
Throws:
FileNotFoundException - if the file with the given name does not exist.
IOException - if an I/O error occurs.
Method Detail

entries

public Enumeration entries()
Returns an enumeration of the tar file entries.

Returns:
an enumeration of the tar file entries.

size

public int size()
Returns the number of entries in the tar file.

Returns:
the number of entries in the tar file.

getEntry

public TarEntry getEntry(String name)
Returns the tar file entry with that name, or null if not found.

Parameters:
name - the name of the entry.
Returns:
the tar file entry, or null if not found.

getInputStream

public InputStream getInputStream(TarEntry entry)
                           throws IOException
Returns the input stream of the data in the given entry.

Parameters:
entry - the entry.
Returns:
the input stream containing the data in that entry.
Throws:
IOException - if an I/O error occurs.

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.