Java Zip File Check isZipFile(File file)

Here you can find the source of isZipFile(File file)

Description

is Zip File

License

Open Source License

Declaration

public static boolean isZipFile(File file) 

Method Source Code

//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;
    }
}

Related

  1. isZipFile(File file)
  2. isZipFile(File file)
  3. isZipFile(File file)
  4. isZipFile(File file)
  5. isZipFile(File file)
  6. isZipFile(File file)
  7. isZipFile(File file)
  8. isZipFile(InputStream stream)
  9. isZipFile(java.io.File file)