public class IOUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
URL_PROTOCOL_FILE
URL protocol for a file in the file system: "file"
|
static String |
URL_PROTOCOL_VFS
URL protocol for a JBoss VFS resource: "vfs"
|
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isDirectoryURL(URL url)
Determine whether the given URL points to a directory in the file system
|
static boolean |
isFileURL(URL url)
Determine whether the given URL points to a resource in the file system,
that is, has protocol "file" or "vfs".
|
static String |
streamToString(InputStream is)
Convert input stream to a string.
|
static byte[] |
toByteArray(URI uri)
Download URI to byte array.
|
static String |
urlToClassName(URI uri)
Return fully qualified class name of class file on a URI.
|
public static final String URL_PROTOCOL_FILE
public static final String URL_PROTOCOL_VFS
public static byte[] toByteArray(URI uri)
uri - uri to processIllegalArgumentException - for download problemspublic static String streamToString(InputStream is)
is - streampublic static boolean isFileURL(URL url)
url - the URL to checkpublic static boolean isDirectoryURL(URL url)
url - the URL to checkpublic static String urlToClassName(URI uri) throws IOException
uri - uri of class fileIOException - any exception on class instantiationCopyright © 2018. All rights reserved.