org.wso2.carbon.utils
Class ArchiveManipulator

java.lang.Object
  extended by org.wso2.carbon.utils.ArchiveManipulator

public class ArchiveManipulator
extends Object


Constructor Summary
ArchiveManipulator()
           
 
Method Summary
 void archiveDir(String destArchive, String sourceDir)
          Archive a directory
 void archiveFile(String from, String to)
          Archive a file
 String[] check(String archive)
          List the contents of an archive
 void extract(String archive, String extractDir)
           
 void extractFromStream(InputStream inputStream, String extractDir)
           
protected  String getZipEntryPath(File f)
           
protected  void zipDir(File zipDir, ZipOutputStream zos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArchiveManipulator

public ArchiveManipulator()
Method Detail

archiveDir

public void archiveDir(String destArchive,
                       String sourceDir)
                throws IOException
Archive a directory

Parameters:
destArchive -
sourceDir -
Throws:
IOException

archiveFile

public void archiveFile(String from,
                        String to)
                 throws IOException
Archive a file

Parameters:
from -
to -
Throws:
IOException

check

public String[] check(String archive)
               throws IOException
List the contents of an archive

Parameters:
archive -
Returns:
List of Zip Entries
Throws:
IOException

extract

public void extract(String archive,
                    String extractDir)
             throws IOException
Throws:
IOException

extractFromStream

public void extractFromStream(InputStream inputStream,
                              String extractDir)
                       throws IOException
Throws:
IOException

zipDir

protected void zipDir(File zipDir,
                      ZipOutputStream zos)
               throws IOException
Throws:
IOException

getZipEntryPath

protected String getZipEntryPath(File f)


Copyright © 2014 WSO2 Inc. All rights reserved.