Package de.uplanet.io

Class TarHelper


  • @Scriptable
    public final class TarHelper
    extends Object
    IOHelper class utility
    • Constructor Detail

      • TarHelper

        public TarHelper()
    • Method Detail

      • tarDir

        public static void tarDir​(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream p_tar,
                                  String p_strRootDir,
                                  Path p_dirSrc,
                                  boolean p_bTarMarkedDirs,
                                  Set<Path> p_filesToExclude)
                           throws 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 parameter is set to false, the destination directory entry is created with a .noxexport entry as the only content.
        p_filesToExclude - files which are not exported parameter is set to false, the directory is exported as it would be empty.
        Throws:
        IOException - If an I/O-error occurs.
      • untarDir

        public static void untarDir​(Path p_fileArchive,
                                    String p_strFileNameEncoding,
                                    String p_strRootDir,
                                    Path p_dirDst)
                             throws IOException
        This method calls untarDir(Path, String, String, Path, Progress) with a null progress parameter.
        Parameters:
        p_fileArchive - The file to be untared.
        p_strFileNameEncoding - encoding used for file names in tar archive
        p_strRootDir - The root dir of the files in the archive, or null, if top level.
        p_dirDst - The destination directory.
        Throws:
        IOException - If an I/O-error occurs.
      • untarDir

        public static boolean untarDir​(Path p_fileArchive,
                                       String p_strFileNameEncoding,
                                       String p_strRootDir,
                                       Path p_dirDst,
                                       de.uplanet.util.Progress p_progress)
                                throws 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_strFileNameEncoding - encoding used for file names in tar archive
        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:
        IOException - If an I/O-error occurs.
      • tarDir

        @Deprecated
        public static void tarDir​(org.apache.commons.compress.archivers.tar.TarArchiveOutputStream p_tar,
                                  String p_strRootDir,
                                  File p_dirSrc,
                                  boolean p_bTarMarkedDirs,
                                  Set<File> p_filesToExclude)
                           throws IOException
        Deprecated.
        Throws:
        IOException