org.gcube.vremanagement.softwaregateway.impl.repositorymanager.maven
Class ArchiveManagement

java.lang.Object
  extended by org.gcube.vremanagement.softwaregateway.impl.repositorymanager.maven.ArchiveManagement

public class ArchiveManagement
extends Object

Archive Management Class

Author:
Luca Frosini (ISTI-CNR)

Field Summary
protected static org.gcube.common.core.utils.logging.GCUBELog logger
          Class logger.
 
Constructor Summary
ArchiveManagement()
           
 
Method Summary
static void createTarGz(File targetArchive, File[] archiveFiles)
          Compress Archive Method.
static void createTarGz(File targetArchive, List<File> archiveFiles)
          Compress Archive Method
 File extractFileFromArchive(File tar, String pathToFile)
           
 void insertFileToArchive(File tar, String pathToFile)
           
 void replaceFilesToTarGz(File source, File file)
           
static void unTarGz(File sourceArchive)
          Uncompress Archive Method ()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.gcube.common.core.utils.logging.GCUBELog logger
Class logger.

Constructor Detail

ArchiveManagement

public ArchiveManagement()
Method Detail

unTarGz

public static void unTarGz(File sourceArchive)
                    throws Exception
Uncompress Archive Method ()

Parameters:
sourceArchive - source archive
Throws:
Exception - if the uncompress operation fails

createTarGz

public static void createTarGz(File targetArchive,
                               List<File> archiveFiles)
                        throws Exception
Compress Archive Method

Parameters:
targetArchive - archive file
archiveFiles - List of files to include in TAR GZ
Throws:
Exception - if the compression fails

createTarGz

public static void createTarGz(File targetArchive,
                               File[] archiveFiles)
                        throws Exception
Compress Archive Method. The first entry in the

Parameters:
targetArchive - archive file
archiveFiles - Array of files to include in TAR GZ. The first entry in the array is the source root directory. It is used to calculate relative path. If it is not supplied the archive will not have directory tree.
Throws:
Exception - if the compression fails

extractFileFromArchive

public File extractFileFromArchive(File tar,
                                   String pathToFile)
                            throws IOException
Throws:
IOException

insertFileToArchive

public void insertFileToArchive(File tar,
                                String pathToFile)
                         throws IOException
Throws:
IOException

replaceFilesToTarGz

public void replaceFilesToTarGz(File source,
                                File file)


Copyright © 2013. All Rights Reserved.