RSE
Release 3.4

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

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

public class TarFile
extends Object

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

Since:
3.0

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.
protected  InputStream getInputStream()
          Gets the input stream for the tar file.
 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

getInputStream

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

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

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.

RSE
Release 3.4

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