Package javajs.util
Class ZipTools
java.lang.Object
javajs.util.ZipTools
- All Implemented Interfaces:
GenericZipTools
Note the JSmol/HTML5 must use its own version of java.util.zip.ZipOutputStream.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addZipEntry
(Object zos, String fileName) cacheZipContents
(BufferedInputStream bis, String fileName, Map<String, Object> cache, boolean asByteArray) void
closeZipEntry
(Object zos) void
getAllZipData
(InputStream is, String[] subfileList, String name0, String binaryFileList, String exclude, Map<String, String> fileData) Deprecated.int
getCrcValue
(byte[] bytes) static String
getUnGzippedInputStream
(byte[] bytes) String[]
getZipDirectoryAndClose
(BufferedInputStream bis, String manifestID) byte[]
getZipFileContentsAsBytes
(BufferedInputStream bis, String[] list, int listPtr) getZipFileDirectory
(BufferedInputStream bis, String[] list, int listPtr, boolean asBufferedInputStream) iteratively drills into zip files of zip files to extract file content or zip file directory.getZipOutputStream
(Object bos) boolean
isZipStream
(Object br) void
readFileAsMap
(BufferedInputStream bis, Map<String, Object> bdata, String name)
-
Constructor Details
-
ZipTools
public ZipTools()
-
-
Method Details
-
newZipInputStream
- Specified by:
newZipInputStream
in interfaceGenericZipTools
-
getAllZipData
@Deprecated public void getAllZipData(InputStream is, String[] subfileList, String name0, String binaryFileList, String exclude, Map<String, String> fileData) Deprecated.- Specified by:
getAllZipData
in interfaceGenericZipTools
-
getZipFileDirectory
public Object getZipFileDirectory(BufferedInputStream bis, String[] list, int listPtr, boolean asBufferedInputStream) iteratively drills into zip files of zip files to extract file content or zip file directory. Also works with JAR files. Does not return "__MACOS" paths- Specified by:
getZipFileDirectory
in interfaceGenericZipTools
- Parameters:
bis
-list
-listPtr
-asBufferedInputStream
- for Pmesh- Returns:
- directory listing or subfile contents
-
getZipFileContentsAsBytes
- Specified by:
getZipFileContentsAsBytes
in interfaceGenericZipTools
-
getZipDirectoryAsStringAndClose
- Specified by:
getZipDirectoryAsStringAndClose
in interfaceGenericZipTools
-
getZipDirectoryAndClose
- Specified by:
getZipDirectoryAndClose
in interfaceGenericZipTools
-
getStreamAsString
- Throws:
IOException
-
newGZIPInputStream
- Specified by:
newGZIPInputStream
in interfaceGenericZipTools
- Throws:
IOException
-
newBZip2InputStream
- Specified by:
newBZip2InputStream
in interfaceGenericZipTools
- Throws:
IOException
-
getUnGzippedInputStream
- Specified by:
getUnGzippedInputStream
in interfaceGenericZipTools
-
addZipEntry
- Specified by:
addZipEntry
in interfaceGenericZipTools
- Throws:
IOException
-
closeZipEntry
- Specified by:
closeZipEntry
in interfaceGenericZipTools
- Throws:
IOException
-
getZipOutputStream
- Specified by:
getZipOutputStream
in interfaceGenericZipTools
-
getCrcValue
public int getCrcValue(byte[] bytes) - Specified by:
getCrcValue
in interfaceGenericZipTools
-
readFileAsMap
- Specified by:
readFileAsMap
in interfaceGenericZipTools
-
cacheZipContents
public String cacheZipContents(BufferedInputStream bis, String fileName, Map<String, Object> cache, boolean asByteArray) - Specified by:
cacheZipContents
in interfaceGenericZipTools
-
isZipStream
- Specified by:
isZipStream
in interfaceGenericZipTools
-