Java Utililty Methods URL Value Check

List of utility methods to do URL Value Check

Description

The list of methods to do URL Value Check are organized into topic(s).

Method

booleanisFile(URL url)
is File
return (url != null) && ((url.getProtocol().equals("file")) || (url.getProtocol().equals("vfsfile")));
booleanisFile(URL url)
is File
return url != null && url.getProtocol().equals(URL_PROTOCOL_FILE);
booleanisFileInJar(URL resource)
Checks if a URL designates a single file in a Jar or not.
return resource.getPath().matches(".*(\\.\\w+)");
booleanisFileResource(URL resource)
is File Resource
return !resource.toExternalForm().endsWith(SLASH);
booleanisFileSpecified(URL url)
Determines whether a file is specified in the path part of the url.
boolean specified = false;
String path = url.getPath();
int posLastSlash = path.lastIndexOf('/');
int posLastDot = path.lastIndexOf('.');
specified = posLastDot > posLastSlash;
return specified;
booleanisFileURL(String path)
is File URL
return isFileURL(getURL(path));
booleanisFileURL(URL repositoryURL)
is File URL
return "file".equalsIgnoreCase(repositoryURL.getProtocol());
booleanisFileURL(URL url)
Returns true if the URL is a file URL
return url.getProtocol().equalsIgnoreCase("file");
booleanisFileURL(URL url)
is File URL
String protocol = url.getProtocol();
return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));
booleanisFileURL(URL url)
Determine whether the given URL points to a resource in the file system, that is, has protocol "file" or "vfs".
String protocol = url.getProtocol();
return (URL_PROTOCOL_FILE.equals(protocol) || protocol.startsWith(URL_PROTOCOL_VFS));