public class IO extends Object
| Constructor and Description |
|---|
IO() |
| Modifier and Type | Method and Description |
|---|---|
static void |
close(Closeable closeable) |
static void |
copy(byte[] from,
File to) |
static void |
copy(byte[] from,
OutputStream to) |
static void |
copy(File from,
File to) |
static void |
copy(File from,
OutputStream to) |
static void |
copy(InputStream from,
File to) |
static void |
copy(InputStream from,
File to,
boolean append) |
static void |
copy(InputStream from,
OutputStream to) |
static void |
copy(URL from,
OutputStream to) |
static void |
copyDirectory(File srcDir,
File destDir) |
static boolean |
delete(File file) |
static InputStream |
read(byte[] content) |
static InputStream |
read(File source) |
static InputStream |
read(String content) |
static InputStream |
read(String content,
String encoding) |
static InputStream |
read(URL url) |
static String |
readFileAsString(URI uri) |
static Properties |
readProperties(File resource) |
static Properties |
readProperties(File resource,
Properties properties) |
static Properties |
readProperties(InputStream in,
Properties properties)
Reads and closes the input stream
|
static Properties |
readProperties(URL resource) |
static Properties |
readProperties(URL resource,
Properties properties) |
static String |
readString(File file) |
static String |
readString(URL url) |
static String |
slurp(File file) |
static String |
slurp(InputStream in) |
static String |
slurp(URL url) |
static ZipInputStream |
unzip(File file) |
static OutputStream |
write(File destination) |
static OutputStream |
write(File destination,
boolean append) |
static void |
writeString(File file,
String string) |
static ZipOutputStream |
zip(File file) |
public static String readFileAsString(URI uri) throws IOException
IOExceptionpublic static Properties readProperties(URL resource) throws IOException
IOExceptionpublic static Properties readProperties(URL resource, Properties properties) throws IOException
IOExceptionpublic static Properties readProperties(File resource) throws IOException
IOExceptionpublic static Properties readProperties(File resource, Properties properties) throws IOException
IOExceptionpublic static Properties readProperties(InputStream in, Properties properties) throws IOException
in - InputStreamproperties - PropertiesIOExceptionpublic static String readString(URL url) throws IOException
IOExceptionpublic static String readString(File file) throws IOException
IOExceptionpublic static String slurp(File file) throws IOException
IOExceptionpublic static String slurp(URL url) throws IOException
IOExceptionpublic static String slurp(InputStream in) throws IOException
IOExceptionpublic static void writeString(File file, String string) throws IOException
IOExceptionpublic static void copy(File from, File to) throws IOException
IOExceptionpublic static void copyDirectory(File srcDir, File destDir) throws IOException
IOExceptionpublic static void copy(File from, OutputStream to) throws IOException
IOExceptionpublic static void copy(URL from, OutputStream to) throws IOException
IOExceptionpublic static void copy(InputStream from, File to) throws IOException
IOExceptionpublic static void copy(InputStream from, File to, boolean append) throws IOException
IOExceptionpublic static void copy(InputStream from, OutputStream to) throws IOException
IOExceptionpublic static void copy(byte[] from,
File to)
throws IOException
IOExceptionpublic static void copy(byte[] from,
OutputStream to)
throws IOException
IOExceptionpublic static ZipOutputStream zip(File file) throws IOException
IOExceptionpublic static ZipInputStream unzip(File file) throws IOException
IOExceptionpublic static void close(Closeable closeable)
public static boolean delete(File file)
public static OutputStream write(File destination) throws FileNotFoundException
FileNotFoundExceptionpublic static OutputStream write(File destination, boolean append) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream read(File source) throws FileNotFoundException
FileNotFoundExceptionpublic static InputStream read(String content)
public static InputStream read(String content, String encoding) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static InputStream read(byte[] content)
public static InputStream read(URL url) throws IOException
IOExceptionCopyright © 1999-2014 The Apache Software Foundation. All Rights Reserved.