public class URIUtils extends Object
| Constructor and Description |
|---|
URIUtils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getDocumentBase(String href)
Returns the document base of the href argument
|
static InputStream |
getInputStream(String href,
String documentBase)
Returns an InputStream for the file represented by the href argument
|
static Reader |
getReader(String href,
String documentBase)
Returns a Reader for the file represented by the href argument
|
static String |
getRelativeURI(String href)
Returns the relative URI of the href argument
|
static String |
normalize(String absoluteURL)
This method removes "." or ".." from absolute URL.
|
static String |
resolveAsString(String href,
String documentBase) |
public static InputStream getInputStream(String href, String documentBase) throws FileNotFoundException, IOException
href - the href of the file to get the input stream for.documentBase - the document base of the href argument, if it is a relative href set
documentBase to null if there is none.FileNotFoundException - when the file could not be foundIOExceptionpublic static Reader getReader(String href, String documentBase) throws FileNotFoundException, IOException
href - the href of the file to get the input stream for.documentBase - the document base of the href argument, if it is a relative href set
documentBase to null if there is none.FileNotFoundException - when the file could not be foundIOExceptionpublic static String getDocumentBase(String href)
public static String getRelativeURI(String href)
public static String normalize(String absoluteURL) throws MalformedURLException
absoluteURL - the absolute URI to normalizeMalformedURLExceptionCopyright © 2016. All rights reserved.