org.exolab.adaptx.net.impl
Class URIUtils
java.lang.Object
org.exolab.adaptx.net.impl.URIUtils
public class URIUtils
extends java.lang.Object
A utility class for URI handling
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 OutputStream | getOutputStream(String href, String documentBase) - Returns an OutputStream 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 Writer | getWriter(String href, String documentBase) - Returns a Writer for the file represented by the href
argument
|
static String | resolveAsString(String href, String documentBase) - Returns the given href + documentBase
|
getDocumentBase
public static String getDocumentBase(String href)
Returns the document base of the href argument
- the document base of the given href
getInputStream
public static InputStream getInputStream(String href,
String documentBase)
throws java.io.FileNotFoundException,
java.io.IOException
Returns an InputStream for the file represented by the href
argument
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.
- an InputStream to the desired resource
getOutputStream
public static OutputStream getOutputStream(String href,
String documentBase)
throws java.io.FileNotFoundException,
java.io.IOException
Returns an OutputStream for the file represented by the href
argument
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.
- an OutputStream to the desired resource
getReader
public static Reader getReader(String href,
String documentBase)
throws java.io.FileNotFoundException,
java.io.IOException
Returns a Reader for the file represented by the href
argument
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.
- an InputStream to the desired resource
getRelativeURI
public static String getRelativeURI(String href)
Returns the relative URI of the href argument
- the relative URI the given href
getWriter
public static Writer getWriter(String href,
String documentBase)
throws java.io.FileNotFoundException,
java.io.IOException
Returns a Writer for the file represented by the href
argument
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.
- a Writer to the desired resource
resolveAsString
public static String resolveAsString(String href,
String documentBase)
Returns the given href + documentBase
- the absolute URL as a string