Java URL Value Check isUrlInJar(URL url)

Here you can find the source of isUrlInJar(URL url)

Description

is Url In Jar

License

GNU General Public License

Parameter

Parameter Description
url The path to inspect.

Exception

Parameter Description
IOException an exception

Return

TRUE if the passed URL is contained in a JAR file.

Declaration

public static boolean isUrlInJar(URL url) throws IOException 

Method Source Code

//package com.java2s;

import java.io.IOException;

import java.net.URL;

public class Main {
    /**/*  ww w.j av  a 2s.c o  m*/
     * @param url The path to inspect.
     * @return TRUE if the passed URL is contained in a JAR file.
     * @throws IOException
     */
    public static boolean isUrlInJar(URL url) throws IOException {
        return url == null ? false : url.toString().startsWith("jar:");
    }
}

Related

  1. isURLAvailable(String url, int timeout)
  2. isUrlAvailable(URL url, Proxy proxy)
  3. isUrlDownWithRetries(String url, long timeoutMs, long retryDelayMs)
  4. isUrlExists(String url)
  5. isURLExists(String URLName)
  6. isUrlResponding(String url)
  7. isUrlValid(final URL url)
  8. isUrlValid(URL url)
  9. isValid(String candidateUrl)