Package org.wso2.carbon.utils
Class ArchiveManipulator
- java.lang.Object
-
- org.wso2.carbon.utils.ArchiveManipulator
-
public class ArchiveManipulator extends Object
-
-
Constructor Summary
Constructors Constructor Description ArchiveManipulator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarchiveDir(String destArchive, String sourceDir)Archive a directoryvoidarchiveFile(String from, String to)Archive a fileString[]check(String archive)List the contents of an archivevoidextract(String archive, String extractDir)voidextractFromStream(InputStream inputStream, String extractDir)protected StringgetZipEntryPath(File f)protected voidzipDir(File zipDir, ZipOutputStream zos)
-
-
-
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
-
-