public final class UriUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.net.URL |
buildJarSafeUrl(java.io.File file) |
static java.net.URL |
buildJarUrl(java.io.File jarFile) |
static java.net.URL |
buildJarUrl(java.io.File jarFile,
java.lang.String entryPath) |
static java.net.URL |
buildJarUrl(java.lang.String fileUrlString) |
static java.net.URL |
buildJarUrl(java.lang.String fileUrlString,
java.lang.String entryPath) |
static java.lang.String |
getWarSeparator() |
static boolean |
hasScheme(java.lang.CharSequence uri)
Determine if a URI string has a
scheme component. |
static boolean |
isAbsoluteURI(java.lang.String path)
Does the provided path start with
file:/ or <protocol>://. |
static java.net.URI |
resolve(java.net.URI base,
java.lang.String target)
Replicates the behaviour of
URI.resolve(String) and adds support for URIs of the form
jar:file:/... . |
static java.net.URL |
warToJar(java.net.URL warUrl)
Convert a URL of the form
war:file:... |
public static boolean hasScheme(java.lang.CharSequence uri)
scheme component.uri - The URI to testtrue if a scheme is present, otherwise {code @false}public static java.net.URL buildJarUrl(java.io.File jarFile)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL buildJarUrl(java.io.File jarFile,
java.lang.String entryPath)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL buildJarUrl(java.lang.String fileUrlString)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL buildJarUrl(java.lang.String fileUrlString,
java.lang.String entryPath)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL buildJarSafeUrl(java.io.File file)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL warToJar(java.net.URL warUrl)
throws java.net.MalformedURLException
war:file:... to jar:file:....warUrl - The WAR URL to convertjava.net.MalformedURLException - If the conversion failspublic static java.lang.String getWarSeparator()
public static boolean isAbsoluteURI(java.lang.String path)
file:/ or <protocol>://.path - The path to testtrue if the supplied path starts with once of the recognised sequences.public static java.net.URI resolve(java.net.URI base,
java.lang.String target)
throws java.net.MalformedURLException,
java.net.URISyntaxException
URI.resolve(String) and adds support for URIs of the form
jar:file:/... .base - The base URI to resolve againsttarget - The path to resolveURI.resolve(String)java.net.MalformedURLException - If the base URI cannot be converted to a URLjava.net.URISyntaxException - If the resulting URL cannot be converted to a URICopyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.