public static boolean isCompleteZip(File file) throws IOException, NonScannableZipException {

        FileChannel channel = null;
        try {
            channel = new FileInputStream(file).getChannel();

            long size = channel.size();
            if (size < ENDLEN) { // Obvious case
                return false;
            }
            else if (validateEndRecord(file, channel, size - ENDLEN)) { // typical case where file is complete and end record has no comment
                return true;
            }

            // Either file is incomplete or the end of central directory record includes an arbitrary length comment
            // So, we have to scan backwards looking for an end of central directory record
            return scanForEndSig(file, channel);
        }
        finally {
            safeClose(channel);
        }
    }
public static boolean isCompleteZip ( File file ) throws IOException , NonScannableZipException { FileChannel channel = null ; try { channel = new FileInputStream ( file ) . getChannel ( ) ; long size = channel . size ( ) ; if ( size < ENDLEN ) { return false ; } else if ( validateEndRecord ( file , channel , size - ENDLEN ) ) { return true ; } return scanForEndSig ( file , channel ) ; } finally { safeClose ( channel ) ; } }
Scans the given file looking for a complete zip file format end of central directory record.

@param file the file

@return true if a complete end of central directory record could be found

@throws IOException