org.eclipse.rse.services.clientserver.archiveutils
Class TarFile
java.lang.Object
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. |
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
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.
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.
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.