Java Zip File Check isZipped(File file)

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

Description

is Zipped

License

BSD License

Declaration

private static boolean isZipped(File file) 

Method Source Code


//package com.java2s;
//License from project: BSD License 

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import java.util.zip.ZipInputStream;

public class Main {
    private static boolean isZipped(File file) {
        try {//  ww w.j  av a2s.  com
            return new ZipInputStream(new FileInputStream(file)).getNextEntry() != null;
        } catch (IOException e) {
            return false;
        }
    }
}

Related

  1. isZipFile(String fileName)
  2. isZipFile(String fileName)
  3. isZipFile(String path)
  4. isZipOrJarArchive(File file)
  5. isZipped(File f)
  6. isZipped(final File file)
  7. isZipped(InputStream inputStream)
  8. isZipped(String name)
  9. isZippedFile(File file)