|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pl.psnc.dl.ege.utils.EGEIOUtils
public final class EGEIOUtils
Pack of usable EGE IO utilities. TODO : switch to external IO Utilities (e.g. from Vesta or Apache Commons)
Method Summary | |
---|---|
static void |
constructZip(java.io.File file,
java.util.zip.ZipOutputStream out,
java.lang.String dir)
Construct zip file from specified dir location. |
static void |
copyStream(java.io.InputStream is,
java.io.OutputStream os)
Perform copy from input stream to output stream. |
static boolean |
deleteDirectory(java.io.File dir)
Deletes a directory. |
static boolean |
isComplexZip(java.io.File zipFile)
Checks if specified zip content contains more than one file. |
static void |
unzipFile(java.util.zip.ZipFile zipFile,
java.io.File destinationDir)
Extracts content of the zipFile to given destination directory |
static void |
unzipSingleFile(java.util.zip.ZipFile zipFile,
java.io.OutputStream os)
Unpacks single file data to stream. |
static void |
unzipStream(java.io.InputStream in,
java.io.File outputDir)
Unzips a zip compressed file to some output directory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void constructZip(java.io.File file, java.util.zip.ZipOutputStream out, java.lang.String dir) throws java.io.IOException
file
- directory to packout
- zip output streamdir
- used for zip entries
java.io.IOException
public static boolean deleteDirectory(java.io.File dir)
dir
- The directory to delete
public static void copyStream(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
is
- source streamos
- result stream
java.io.IOException
public static void unzipFile(java.util.zip.ZipFile zipFile, java.io.File destinationDir) throws java.io.FileNotFoundException, java.io.IOException
zipFile
- the file to unzipdestinationDir
- destination directory for the content of the zipFile
java.io.FileNotFoundException
- if a file could not be created
java.io.IOException
- if IO error occurspublic static void unzipStream(java.io.InputStream in, java.io.File outputDir) throws java.io.FileNotFoundException, java.io.IOException
in
- The InputStream.outputDir
- The output directory.
java.io.IOException
java.io.FileNotFoundException
public static boolean isComplexZip(java.io.File zipFile) throws java.io.IOException
zipFile
-
java.io.IOException
public static void unzipSingleFile(java.util.zip.ZipFile zipFile, java.io.OutputStream os) throws java.io.IOException
zipFile
- os
-
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |