public class IOUtil
extends java.lang.Object
| Constructor and Description |
|---|
IOUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(java.io.Closeable closeable)
Closes the target.
|
static void |
createDirectory(java.io.File file) |
static void |
createParentDirectory(java.io.File file) |
static void |
downloadToFile(java.lang.String url,
java.io.File file)
Downloads resource and saves it to a given file
|
static java.lang.String |
readFully(java.io.File input)
Reads string from the file
|
static java.lang.String |
readFully(java.io.InputStream stream)
Reads string from the stream and closes it
|
static void |
writeFile(java.io.File target,
java.lang.String content) |
public static java.lang.String readFully(java.io.File input)
public static java.lang.String readFully(java.io.InputStream stream)
public static void close(java.io.Closeable closeable)
closeable - the target, may be nullpublic static void createParentDirectory(java.io.File file)
public static void createDirectory(java.io.File file)
public static void downloadToFile(java.lang.String url,
java.io.File file)
url - location of resource to downloadfile - destination file (not a directory!) where downloaded content will be stored
(file or its parent directories don't need to exist)public static void writeFile(java.io.File target,
java.lang.String content)