org.apache.openejb.loader
Class IO

java.lang.Object
  extended by org.apache.openejb.loader.IO

public class IO
extends Object

Version:
$Revision$ $Date$

Constructor Summary
IO()
           
 
Method Summary
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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IO

public IO()
Method Detail

readFileAsString

public static String readFileAsString(URI uri)
                               throws IOException
Throws:
IOException

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

readProperties

public static Properties readProperties(InputStream in,
                                        Properties properties)
                                 throws IOException
Reads and closes the input stream

Parameters:
in - InputStream
properties - Properties
Returns:
Properties
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(File file)
                    throws IOException
Throws:
IOException

slurp

public static String slurp(URL url)
                    throws IOException
Throws:
IOException

slurp

public static String slurp(InputStream in)
                    throws IOException
Throws:
IOException

writeString

public static void writeString(File file,
                               String string)
                        throws IOException
Throws:
IOException

copy

public static void copy(File from,
                        File to)
                 throws IOException
Throws:
IOException

copyDirectory

public static void copyDirectory(File srcDir,
                                 File destDir)
                          throws IOException
Throws:
IOException

copy

public static void copy(File from,
                        OutputStream to)
                 throws IOException
Throws:
IOException

copy

public static void copy(URL 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

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

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 void close(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(String content)

read

public static InputStream read(String content,
                               String encoding)
                        throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

read

public static InputStream read(byte[] content)

read

public static InputStream read(URL url)
                        throws IOException
Throws:
IOException


Copyright © 1999-2013 The Apache Software Foundation. All Rights Reserved.