Here you can find the source of isZipFile(File file)
static boolean isZipFile(File file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; import java.util.zip.ZipInputStream; public class Main { static boolean isZipFile(File file) throws IOException { return new ZipInputStream(new FileInputStream(file)).getNextEntry() != null; }/* w w w . j a v a 2 s . co m*/ }