Here you can find the source of isZipFile(File file)
public static boolean isZipFile(File file)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.util.zip.ZipException; import java.util.zip.ZipFile; public class Main { public static boolean isZipFile(File file) { boolean b = false; try {//from w w w. j a va2 s . c om ZipFile zf = new ZipFile(file); zf.close(); b = true; } catch (ZipException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return b; } }