Class IO
- java.lang.Object
-
- org.apache.openejb.arquillian.common.IO
-
public class IO extends Object
- Version:
- $Revision$ $Date$
-
-
Constructor Summary
Constructors Constructor Description IO()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IOExceptionclose(Closeable closeable)static voidcloseSilently(Closeable closeable)static voidcopy(byte[] from, File to)static voidcopy(byte[] from, OutputStream to)static voidcopy(File from, File to)static voidcopy(File from, OutputStream to)static voidcopy(InputStream from, File to)static voidcopy(InputStream from, File to, boolean append)static voidcopy(InputStream from, OutputStream to)static booleandelete(File file)static InputStreamread(byte[] content)static InputStreamread(File source)static InputStreamread(URL url)static PropertiesreadProperties(File resource)static PropertiesreadProperties(File resource, Properties properties)static PropertiesreadProperties(InputStream in, Properties properties)Reads and closes the input streamstatic PropertiesreadProperties(URL resource)static PropertiesreadProperties(URL resource, Properties properties)static StringreadString(File file)static StringreadString(URL url)static Stringslurp(File file)static Stringslurp(InputStream in)static Stringslurp(String fileName)static Stringslurp(URL url)static byte[]slurpBytes(File file)static ZipInputStreamunzip(File file)static OutputStreamwrite(File destination)static OutputStreamwrite(File destination, boolean append)static PropertieswriteProperties(File resource, Properties properties)static PropertieswriteProperties(OutputStream outputStream, Properties properties)static voidwriteString(File file, String string)static ZipOutputStreamzip(File file)
-
-
-
Method Detail
-
readProperties
public static Properties readProperties(URL resource) throws IOException
- Throws:
IOException
-
readProperties
public static Properties readProperties(URL resource, Properties properties) throws IOException
- Throws:
IOException
-
readProperties
public static Properties readProperties(File resource) throws IOException
- Throws:
IOException
-
readProperties
public static Properties readProperties(File resource, Properties properties) throws IOException
- Throws:
IOException
-
writeProperties
public static Properties writeProperties(File resource, Properties properties) throws IOException
- Throws:
IOException
-
readProperties
public static Properties readProperties(InputStream in, Properties properties) throws IOException
Reads and closes the input stream- Parameters:
in-properties-- Returns:
- Throws:
IOException
-
writeProperties
public static Properties writeProperties(OutputStream outputStream, Properties properties) throws IOException
- Parameters:
outputStream-properties-- Returns:
- Throws:
IOException
-
readString
public static String readString(URL url) throws IOException
- Throws:
IOException
-
readString
public static String readString(File file) throws IOException
- Throws:
IOException
-
slurp
public static String slurp(String fileName) throws IOException
- Throws:
IOException
-
slurpBytes
public static byte[] slurpBytes(File file) throws IOException
- Throws:
IOException
-
slurp
public static String slurp(File file) throws IOException
- Throws:
IOException
-
slurp
public static String slurp(InputStream in) throws IOException
- Throws:
IOException
-
slurp
public static String slurp(URL url) throws IOException
- Throws:
IOException
-
writeString
public static void writeString(File file, String string) throws IOException
- Throws:
IOException
-
copy
public static void copy(File from, OutputStream to) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, File to) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, File to, boolean append) throws IOException
- Throws:
IOException
-
copy
public static void copy(InputStream from, OutputStream to) throws IOException
- Throws:
IOException
-
zip
public static ZipOutputStream zip(File file) throws IOException
- Throws:
IOException
-
unzip
public static ZipInputStream unzip(File file) throws IOException
- Throws:
IOException
-
close
public static IOException close(Closeable closeable) throws IOException
- Throws:
IOException
-
copy
public static void copy(File from, File to) throws IOException
- Throws:
IOException
-
copy
public static void copy(byte[] from, File to) throws IOException- Throws:
IOException
-
copy
public static void copy(byte[] from, OutputStream to) throws IOException- Throws:
IOException
-
closeSilently
public static void closeSilently(Closeable closeable)
-
delete
public static boolean delete(File file)
-
write
public static OutputStream write(File destination) throws FileNotFoundException
- Throws:
FileNotFoundException
-
write
public static OutputStream write(File destination, boolean append) throws FileNotFoundException
- Throws:
FileNotFoundException
-
read
public static InputStream read(File source) throws FileNotFoundException
- Throws:
FileNotFoundException
-
read
public static InputStream read(byte[] content)
-
read
public static InputStream read(URL url) throws IOException
- Throws:
IOException
-
-