de.uplanet.io
Class TarHelper

java.lang.Object
  extended by de.uplanet.io.TarHelper

@Scriptable
public final class TarHelper
extends java.lang.Object

IOHelper class utility

Version:
$Revision: 86964 $

Constructor Summary
TarHelper()
           
 
Method Summary
static void tarDir(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream p_tar, java.lang.String p_strRootDir, java.io.File p_dirSrc, boolean p_bTarMarkedDirs, java.util.Set<java.io.File> p_filesToExclude)
          Copy a directory recursively to a tar output stream.
static void untarDir(java.io.File p_fileArchive, java.lang.String p_strRootDir, java.io.File p_dirDst)
          This method calls untarDir(File, String, File, Progress) with a null progress parameter.
static boolean untarDir(java.io.File p_fileArchive, java.lang.String p_strRootDir, java.io.File p_dirDst, de.uplanet.util.Progress p_progress)
          Copy a directory recursively from a tar, tgz or tar.gz file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TarHelper

public TarHelper()
Method Detail

tarDir

public static void tarDir(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream p_tar,
                          java.lang.String p_strRootDir,
                          java.io.File p_dirSrc,
                          boolean p_bTarMarkedDirs,
                          java.util.Set<java.io.File> p_filesToExclude)
                   throws java.io.IOException
Copy a directory recursively to a tar output stream.
p_dest is the parent directory of the new directory

Parameters:
p_tar - tar output stream
p_strRootDir - root dir for the added files, or null, if top level
p_dirSrc - directory to copy
p_bTarMarkedDirs - zips directories, event if they are marked with a ".noexport" file. If this
p_filesToExclude - files which are not exported parameter is set to false, the directory is exported as it would be empty.
Throws:
java.io.IOException - If an I/O-error occurs.

untarDir

public static void untarDir(java.io.File p_fileArchive,
                            java.lang.String p_strRootDir,
                            java.io.File p_dirDst)
                     throws java.io.IOException
This method calls untarDir(File, String, File, Progress) with a null progress parameter.

Parameters:
p_fileArchive - The file to be untared.
p_strRootDir - The root dir of the files in the archive, or null, if top level.
p_dirDst - The destination directory.
Throws:
java.io.IOException - If an I/O-error occurs.

untarDir

public static boolean untarDir(java.io.File p_fileArchive,
                               java.lang.String p_strRootDir,
                               java.io.File p_dirDst,
                               de.uplanet.util.Progress p_progress)
                        throws java.io.IOException
Copy a directory recursively from a tar, tgz or tar.gz file.
p_dirDst is the parent directory of the new directory.

Parameters:
p_fileArchive - The file to be untared.
p_strRootDir - The root dir of the files in the archive, or null, if top level.
p_dirDst - The destination directory.
p_progress - The progress callback to be used. May be null.
Returns:
true, if this method created any files or directories, false otherwise
Throws:
java.io.IOException - If an I/O-error occurs.


Last updated: 2011-08-11 10-04
Copyright © 2000-2011 United Planet. All Rights Reserved.