Here you can find the source of isJarFile(File file)
Parameter | Description |
---|---|
file | a parameter |
public static boolean isJarFile(File file)
//package com.java2s; /**/*www. j a va2s . c o m*/ * 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 { private static final String JAR_EXTENSION = ".jar"; /** * Returns true if the given file is a jar file and false otherwise. * * @param file * @return true if the given file is a jar file and false otherwise. */ public static boolean isJarFile(File file) { return file.isFile() && file.getName().toLowerCase().endsWith(JAR_EXTENSION); } }