List of utility methods to do URL Value Check
boolean | isJarURL(URL url) is Jar URL String protocol = url.getProtocol(); return "jar".equals(protocol) || "zip".equals(protocol) || "wsjar".equals(protocol) || "code-source".equals(protocol) && url.getPath().contains("!/"); |
boolean | isJarURL(URL url) Returns true if specified URL is a jar: URL, otherwise returns false
return "jar".equals(url.getProtocol()); |
boolean | isJarURL(URL url) Is this URL a Jar URL? String surl = url.toString(); if (surl.endsWith(".jar") || surl.startsWith("jar:")) { return true; return false; |
boolean | isJarURL(URL url) is Jar URL String protocol = url.getProtocol();
return (URL_PROTOCOL_JAR.equals(protocol) || URL_PROTOCOL_ZIP.equals(protocol)
|| URL_PROTOCOL_VFSZIP.equals(protocol) || URL_PROTOCOL_WSJAR.equals(protocol));
|
boolean | isJBoss5Url(URL fileUrl) Check if given URL is pointing to JBoss 5 VFS resource final String protocol = fileUrl.getProtocol(); return JBOSS5_VFSZIP.equals(protocol) || JBOSS5_VFSMEMORY.equals(fileUrl.getProtocol()); |
boolean | isLegalURL(final String url) Proves if the given string is a valid URL. if ((url == null) || (url.trim().length() == 0)) { return false; try { final URL u = new URL(url); u.openConnection(); return true; } catch (final MalformedURLException e) { ... |
boolean | isLocal(URL aURL) Returns whether a URL is local. String url = aURL.toExternalForm().toLowerCase(); return url.startsWith("file:") || url.startsWith("jar:file:"); |
boolean | isLocalFile(URL url) Adapted from http://www.java2s.com/Code/Java/Network-Protocol/IsURLalocalfile.htm return ((url.getProtocol().equals("file")) && (url.getHost() == null || url.getHost().equals(""))); |
boolean | isLocalFile(URL url) is Local File if (url.getProtocol().equals("file") && (url.getAuthority() == null || url.getAuthority().equals("")) && (url.getHost() == null || url.getHost().equals(("")))) { return true; return false; |
boolean | isLocalFile(URL url) is Local File try { if (url.getProtocol().equals(new File(url.getFile()).toURI().toURL().getProtocol())) { return true; } catch (Throwable throwable) { throwable.printStackTrace(); return false; ... |