List of utility methods to do Zip File Check
boolean | isZippedFile(File file) Returns true if the input file is a zipped file. return isGzipFile(file) || isZipFile(file) || isBZipFile(file) || isUnixCompressFile(file);
|
boolean | isZipStream(ByteArrayInputStream input) is Zip Stream boolean isZip = true; int length = ZIP_HEADER.length; try { input.mark(length + 1); for (int i = 0; i < length; i++) { byte read = (byte) input.read(); if (read != ZIP_HEADER[i]) { isZip = false; ... |
boolean | isZipStream(InputStream in) The method to test if a input stream is a zip archive. if (!in.markSupported()) { throw new IOException("The stream does not support mark."); boolean isZip = true; try { in.mark(MAGIC.length); for (int i = 0; i < MAGIC.length; i++) { if (MAGIC[i] != (byte) in.read()) { ... |
boolean | isZipValid(File file) is Zip Valid try (ZipFile zipFile = new ZipFile(file)) { return true; } catch (IOException ioe) { return false; |
boolean | isZipValid(final File zip) Check if the given zip file is valid. ZipFile zipfile = null; try { zipfile = new ZipFile(zip); return true; } catch (ZipException e) { return false; } catch (IOException e) { return false; ... |