public final class URLUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
URI_WINDOWS_FILE_PATTERN
While URIs that contain pipe are wrong, we'll work around that
for [WSTX-275].
|
Modifier | Constructor and Description |
---|---|
private |
URLUtil() |
Modifier and Type | Method and Description |
---|---|
private static java.lang.String |
cleanSystemId(java.lang.String sysId) |
static java.io.InputStream |
inputStreamFromURL(java.net.URL url)
Method that tries to get a stream (ideally, optimal one) to read from
the specified URL.
|
static java.io.OutputStream |
outputStreamFromURL(java.net.URL url)
Method that tries to get a stream (ideally, optimal one) to write to
the resource specified by given URL.
|
private static void |
throwIOException(java.lang.Exception mex,
java.lang.String sysId)
Helper method that tries to fully convert strange URL-specific exception
to more general IO exception.
|
static java.net.URL |
toURL(java.io.File f)
Helper method that will convert given file into equivalent URL.
|
static java.net.URI |
uriFromSystemId(java.lang.String sysId) |
static java.net.URL |
urlFromCurrentDir()
Method that tries to create and return URL that denotes current
working directory.
|
static java.net.URL |
urlFromSystemId(java.lang.String sysId)
Method that tries to figure out how to create valid URL from a system
id, without additional contextual information.
|
static java.net.URL |
urlFromSystemId(java.lang.String sysId,
java.net.URL ctxt) |
private static final java.util.regex.Pattern URI_WINDOWS_FILE_PATTERN
public static java.net.URL urlFromSystemId(java.lang.String sysId) throws java.io.IOException
java.io.IOException
public static java.net.URI uriFromSystemId(java.lang.String sysId) throws java.io.IOException
java.io.IOException
public static java.net.URL urlFromSystemId(java.lang.String sysId, java.net.URL ctxt) throws java.io.IOException
java.io.IOException
public static java.net.URL urlFromCurrentDir() throws java.io.IOException
java.io.IOException
public static java.io.InputStream inputStreamFromURL(java.net.URL url) throws java.io.IOException
java.io.IOException
public static java.io.OutputStream outputStreamFromURL(java.net.URL url) throws java.io.IOException
java.io.IOException
public static java.net.URL toURL(java.io.File f) throws java.io.IOException
File.toURL()
method.java.io.IOException
private static java.lang.String cleanSystemId(java.lang.String sysId)
private static void throwIOException(java.lang.Exception mex, java.lang.String sysId) throws java.io.IOException
java.io.IOException