| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static String | |
| public static URL | |
| public static InputStream | inputStreamFromURL(URL url)
Method that tries to get a stream (ideally, optimal one) to read from the specified URL. |
| public static OutputStream | outputStreamFromURL(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(MalformedURLException mex, String sysId)
Helper method that tries to fully convert strange URL-specific exception to more general IO exception. |
| public static URL | urlFromCurrentDir()
Method that tries to create and return URL that denotes current working directory. |
| public static URL | urlFromSystemId(String sysId)
Method that tries to figure out how to create valid URL from a system id, without additional contextual information. |
| public static URL | |
| public static String |
| URLUtil | back to summary |
|---|---|
| private URLUtil() | |
| fileToSystemId | back to summary |
|---|---|
| public static String fileToSystemId(File f) throws IOException | |
| fileToURL | back to summary |
|---|---|
| public static URL fileToURL(File f) throws IOException This method is added because the default conversion using
| |
| inputStreamFromURL | back to summary |
|---|---|
| public static InputStream inputStreamFromURL(URL url) throws IOException Method that tries to get a stream (ideally, optimal one) to read from the specified URL. Currently it just means creating a simple file input stream if the URL points to a (local) file, and otherwise relying on URL classes input stream creation method. | |
| outputStreamFromURL | back to summary |
|---|---|
| public static OutputStream outputStreamFromURL(URL url) throws IOException Method that tries to get a stream (ideally, optimal one) to write to the resource specified by given URL. Currently it just means creating a simple file output stream if the URL points to a (local) file, and otherwise relying on URL classes input stream creation method. | |
| throwIoException | back to summary |
|---|---|
| private static void throwIoException(MalformedURLException mex, String sysId) throws IOException Helper method that tries to fully convert strange URL-specific exception to more general IO exception. Also, to try to use JDK 1.4 feature without creating requirement, uses reflection to try to set the root cause, if we are running on JDK1.4 | |
| urlFromCurrentDir | back to summary |
|---|---|
| public static URL urlFromCurrentDir() throws IOException Method that tries to create and return URL that denotes current working directory. Usually used to create a context, when one is not explicitly passed. | |
| urlFromSystemId | back to summary |
|---|---|
| public static URL urlFromSystemId(String sysId) throws IOException Method that tries to figure out how to create valid URL from a system id, without additional contextual information. We could perhaps use java.net.URI class in future? | |
| urlFromSystemId | back to summary |
|---|---|
| public static URL urlFromSystemId(String sysId, URL ctxt) throws IOException | |
| urlToSystemId | back to summary |
|---|---|
| public static String urlToSystemId(URL u) | |