org.gcube.vremanagement.softwarerepository.util
Class ArchiveManagement

java.lang.Object
  extended by org.gcube.vremanagement.softwarerepository.util.ArchiveManagement

public class ArchiveManagement
extends java.lang.Object

Archive Management Class

Author:
Luca Frosini (ISTI-CNR)

Constructor Summary
ArchiveManagement()
           
 
Method Summary
static void createTarGz(java.io.File targetArchive, java.io.File[] archiveFiles)
          Compress Archive Method.
static void createTarGz(java.io.File targetArchive, java.util.List<java.io.File> archiveFiles)
          Compress Archive Method
static java.io.File downloadArchive(java.io.File targetDirectory, java.lang.String fromURL)
          Download Archive method
static void unTarGz(java.io.File sourceArchive)
          Uncompress Archive Method ()
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveManagement

public ArchiveManagement()
Method Detail

downloadArchive

public static java.io.File downloadArchive(java.io.File targetDirectory,
                                           java.lang.String fromURL)
                                    throws java.lang.Exception
Download Archive method

Parameters:
targetDirectory - directory to save the package (the directory will be created)
fromURL - where download the archive
Returns:
File dowloaded
Throws:
java.lang.Exception - if local store of Service Archive fails

unTarGz

public static void unTarGz(java.io.File sourceArchive)
                    throws java.lang.Exception
Uncompress Archive Method ()

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

createTarGz

public static void createTarGz(java.io.File targetArchive,
                               java.util.List<java.io.File> archiveFiles)
                        throws java.lang.Exception
Compress Archive Method

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

createTarGz

public static void createTarGz(java.io.File targetArchive,
                               java.io.File[] archiveFiles)
                        throws java.lang.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:
java.lang.Exception - if the compression fails