Here you can find the source of isZipFile(File file)
Parameter | Description |
---|---|
file | a parameter |
public static boolean isZipFile(File file)
//package com.java2s; /**/*from w ww.ja va2s . c om*/ * Copyright (c) 2013-2016 Angelo ZERR. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation */ import java.io.File; public class Main { public static final String ZIP_EXTENSION = ".zip"; /** * Returns true if the given file is a zip file and false otherwise. * * @param file * @return true if the given file is a zip file and false otherwise. */ public static boolean isZipFile(File file) { return file.isFile() && file.getName().toLowerCase().endsWith(ZIP_EXTENSION); } }