Here you can find the source of isJar(URL url)
public static boolean isJar(URL url)
//package com.java2s; //License from project: Apache License import java.net.URL; public class Main { public static boolean isJar(URL url) { if (url.getProtocol() != null && url.getProtocol().length() > 0) { if (url.getProtocol().equalsIgnoreCase("jar")) { return true; }// w w w . ja v a2 s . co m } return url.getPath().endsWith(".jar"); } }