RSE
Release 3.2

org.eclipse.rse.services.clientserver.archiveutils
Class TarFile

java.lang.Object
  extended by org.eclipse.rse.services.clientserver.archiveutils.TarFile

public class TarFile
extends java.lang.Object

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

Since:
3.0

Constructor Summary
TarFile(java.io.File file)
          Opens a tar file for reading given the specified File object.
TarFile(java.lang.String name)
          Opens a tar file for reading given the file name.
 
Method Summary
 java.util.Enumeration entries()
          Returns an enumeration of the tar file entries.
 TarEntry getEntry(java.lang.String name)
          Returns the tar file entry with that name, or null if not found.
protected  java.io.InputStream getInputStream()
          Gets the input stream for the tar file.
 java.io.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(java.io.File file)
        throws java.io.FileNotFoundException,
               java.io.IOException
Opens a tar file for reading given the specified File object.

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

TarFile

public TarFile(java.lang.String name)
        throws java.io.FileNotFoundException,
               java.io.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:
java.io.FileNotFoundException - if the file with the given name does not exist.
java.io.IOException - if an I/O error occurs.
Method Detail

getInputStream

protected java.io.InputStream getInputStream()
                                      throws java.io.FileNotFoundException
Gets the input stream for the tar file.

Returns:
the input stream for the tar file.
Throws:
java.io.FileNotFoundException - if the file does not exist.
Since:
3.0

entries

public java.util.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(java.lang.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 java.io.InputStream getInputStream(TarEntry entry)
                                   throws java.io.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:
java.io.IOException - if an I/O error occurs.

RSE
Release 3.2

Copyright (c) IBM Corporation and others 2000, 2010. All Rights Reserved.