Package org.apache.tomcat.util.buf
Class UriUtil
java.lang.Object
org.apache.tomcat.util.buf.UriUtil
Utility class for working with URIs and URLs.
- 
Method SummaryModifier and TypeMethodDescriptionstatic URLbuildJarSafeUrl(File file) static URLbuildJarUrl(File jarFile) static URLbuildJarUrl(File jarFile, String entryPath) static URLbuildJarUrl(String fileUrlString) static URLbuildJarUrl(String fileUrlString, String entryPath) static Stringstatic booleanhasScheme(CharSequence uri) Determine if a URI string has aschemecomponent.static booleanisAbsoluteURI(String path) Does the provided path start withfile:/or<protocol>://.static URIReplicates the behaviour ofURI.resolve(String)and adds support for URIs of the formjar:file:/....static URLConvert a URL of the formwar:file:...tojar:file:....
- 
Method Details- 
hasSchemeDetermine if a URI string has aschemecomponent.- Parameters:
- uri- The URI to test
- Returns:
- trueif a scheme is present, otherwise {code @false}
 
- 
buildJarUrl- Throws:
- MalformedURLException
 
- 
buildJarUrl- Throws:
- MalformedURLException
 
- 
buildJarUrl- Throws:
- MalformedURLException
 
- 
buildJarUrl- Throws:
- MalformedURLException
 
- 
buildJarSafeUrl- Throws:
- MalformedURLException
 
- 
warToJarConvert a URL of the formwar:file:...tojar:file:....- Parameters:
- warUrl- The WAR URL to convert
- Returns:
- The equivalent JAR URL
- Throws:
- MalformedURLException- If the conversion fails
 
- 
getWarSeparator
- 
isAbsoluteURIDoes the provided path start withfile:/or<protocol>://.- Parameters:
- path- The path to test
- Returns:
- trueif the supplied path starts with once of the recognised sequences.
 
- 
resolveReplicates the behaviour ofURI.resolve(String)and adds support for URIs of the formjar:file:/....- Parameters:
- base- The base URI to resolve against
- target- The path to resolve
- Returns:
- The resulting URI as per URI.resolve(String)
- Throws:
- MalformedURLException- If the base URI cannot be converted to a URL
- URISyntaxException- If the resulting URL cannot be converted to a URI
 
 
-