Here you can find the source of isZipFile(File f)
public static boolean isZipFile(File f)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; public class Main { public static boolean isZipFile(File f) { RandomAccessFile r;/*from w w w .j a va2 s.c o m*/ try { r = new RandomAccessFile(f, "r"); if (r.readInt() == 0x504b0304) { r.close(); return true; } else { r.close(); return false; } } catch (IOException e) { return false; } } }