Package org.eclipse.rdf4j.common.io
Class ZipUtil
java.lang.Object
org.eclipse.rdf4j.common.io.ZipUtil
Zip-related utilities.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Extract the contents of a zipfile to a directory.static void
Extract the contents of a zipfile to a directory.static boolean
Test if an input stream is a zip input stream by checking the "magic number"static void
writeEntry
(ZipFile zipFile, ZipEntry entry, File destDir) Write an entry to a zip file.
-
Constructor Details
-
ZipUtil
public ZipUtil()
-
-
Method Details
-
isZipStream
Test if an input stream is a zip input stream by checking the "magic number"- Parameters:
in
- input stream- Returns:
- true if start of input stream matches magic number
- Throws:
IOException
-
extract
Extract the contents of a zipfile to a directory.- Parameters:
zipFile
- the zip file to extractdestDir
- the destination directory- Throws:
IOException
- when something untoward happens during the extraction process
-
extract
Extract the contents of a zipfile to a directory.- Parameters:
zipFile
- the zip file to extractdestDir
- the destination directory- Throws:
IOException
- when something untoward happens during the extraction process
-
writeEntry
Write an entry to a zip file.- Parameters:
zipFile
- the zip file to read fromentry
- the entry to processdestDir
- the file to write to- Throws:
IOException
- if the entry could not be processed
-