SORTIE Java Interface
1
|
Functions for working with tarballs (.gz.tar files). More...
Static Public Member Functions | |
static String | extractTarball (String sTarball, String sTempRoot) throws ModelException |
Extracts a tarball's entries into the designated temp folder. More... | |
static String | extractTarballNoPath (String sTarball, String sTempRoot) throws ModelException |
Extracts a tarball's entries into the designated temp folder. More... | |
static InputStream | getUnzipFileStream (String sFileToGet) throws ModelException |
This converts a gzipped file to an uncompressed file stream. More... | |
static void | makeTarball (String sTarball, String[] p_sFiles) throws ModelException |
Creates a tarball from a set of files. More... | |
static String | unzipFile (String sFile) throws ModelException |
Unzips a file. More... | |
static String | zipFile (String sFile) throws ModelException |
Zips a file. More... | |
static String | extractTarballFile (String sTarball, String sFileName) throws ModelException |
Extracts a file from .gz.tar land to plaintext. More... | |
static String | extractTarballFileToPath (String sTarball, String sFileName, String sDestinationPath) throws ModelException |
Extracts a file from .gz.tar land to plaintext. More... | |
static void | cleanUp (String sTarball, String sTempDir, String sTempRoot) throws ModelException |
Deletes all files from the tarball in the temp folder. More... | |
static String [] | getTarballEntries (String sTarball) throws ModelException |
Gets a list of file entries in the tarball. More... | |
Functions for working with tarballs (.gz.tar files).
Copyright: Copyright (c) Charles D. Canham 2003
Company: Cary Institute of Ecosystem Studies
Edit history:
---------------—
April 28, 2004: Submitted in beta version (LEM)
October 1, 2007: Improvements to use cross-system files
October 26, 2007: Updated to be able to work around the @longlink naming problem - the inability of older versions of TAR (such as ours) to handle long filenames (LEM)
February 4, 2008: Updated to conform to Java 6 compliance (LEM)\
February 22, 2011: Corrected a bug relating to opening files without an associated path (LEM)
|
static |
Deletes all files from the tarball in the temp folder.
sTarball | Tarball with the files to delete. |
sTempDir | Directory from which files should be cleaned |
sTempRoot | Temp directory root |
|
static |
Extracts a tarball's entries into the designated temp folder.
If there is file info in the tar archive, they automatically get put in a sub folder of the root directory.
sTarball | Tarball to extract |
sTempRoot | Temp root directory |
ModelException | wraps IOExceptions. |
|
static |
Extracts a file from .gz.tar land to plaintext.
The file will be placed in the same directory as the tarball.
sTarball | Tarball in which the file is. |
sFileName | Name of file to extract, with no path information and with no .gz or .tar extension (but with its plaintext extension). |
ModelException | if the file is bad. |
|
static |
Extracts a file from .gz.tar land to plaintext.
The file will be placed in the chosen directory.
sTarball | Tarball in which the file is. |
sFileName | Name of file to extract. |
sDestinationPath | Path to extract to. |
ModelException | if the file is bad. |
|
static |
Extracts a tarball's entries into the designated temp folder.
If there is file info in the tar archive, they automatically get put in a sub folder of the root directory.
sTarball | Tarball to extract |
sTempRoot | Temp root directory |
ModelException | wraps IOExceptions. |
|
static |
Gets a list of file entries in the tarball.
The list is of the core XML files, with no paths attached.
sTarball | Tarball for which to get entries. |
ModelException | if there is a problem reading the file. |
|
static |
This converts a gzipped file to an uncompressed file stream.
sFileToGet | - the file to uncompress. |
ModelException | if the file is not found, or wrapping another exception. |
|
static |
Creates a tarball from a set of files.
sTarball | Tarball to create |
p_sFiles | Files to put into the tarball |
ModelException |
|
static |
Unzips a file.
As with gzip, this will delete the original file.
sFile | File to unzip. |
ModelException | If there is a problem writing the file. |
|
static |
Zips a file.
As with gzip, this will delete the original file.
sFile | File to zip. |
ModelException | If something goes wrong in the zipping. |