Here you can find the source of isJar(final URI uri)
Parameter | Description |
---|---|
uri | a parameter |
public static boolean isJar(final URI uri)
//package com.java2s; /*/*from w w w . j a v a 2 s . c om*/ * Copyright (c) 2014 Stephan D. Cote' - All rights reserved. * * This program and the accompanying materials are made available under the * terms of the MIT License which accompanies this distribution, and is * available at http://creativecommons.org/licenses/MIT/ * * Contributors: * Stephan D. Cote * - Initial concept and initial implementation */ import java.net.URI; import java.net.URL; public class Main { /** * Is the URI representing a JAR file?? * * * @param uri * @return True if the URI is representing a JAR file */ public static boolean isJar(final URI uri) { if ((uri != null) && (uri.getScheme() != null)) { return uri.getScheme().equalsIgnoreCase("jar"); } return false; } /** * Is the URL representing a JAR file?? * * * @param url * @return True if the URL is representing a JAR file */ public static boolean isJar(final URL url) { if ((url != null) && (url.getProtocol() != null)) { return url.getProtocol().equalsIgnoreCase("jar"); } return false; } }