org.apache.ftpserver.util
Class IoUtils

java.lang.Object
  extended by org.apache.ftpserver.util.IoUtils

public class IoUtils
extends Object

Internal class, do not use directly. IO utility methods. Note: Why not use commons-io? While many of these utility methods are also provided by the Apache commons-io library we prefer to our own implementation to, using a external library might cause additional constraints on users embedding FtpServer.

Author:
Apache MINA Project

Constructor Summary
IoUtils()
           
 
Method Summary
static void close(InputStream is)
          No exception InputStream close method.
static void close(OutputStream os)
          No exception OutputStream close method.
static void close(Reader rd)
          No exception java.io.Reader close method.
static void close(Writer wr)
          No exception java.io.Writer close method.
static void copy(InputStream input, OutputStream output, int bufferSize)
          Copy chars from a InputStream to a OutputStream .
static void copy(Reader input, Writer output, int bufferSize)
          Copy chars from a Reader to a Writer.
static void delete(File file)
           
static BufferedInputStream getBufferedInputStream(InputStream in)
          Get a BufferedInputStream.
static BufferedOutputStream getBufferedOutputStream(OutputStream out)
          Get a BufferedOutputStream.
static BufferedReader getBufferedReader(Reader reader)
          Get BufferedReader.
static BufferedWriter getBufferedWriter(Writer wr)
          Get BufferedWriter.
static String getStackTrace(Throwable ex)
          Get exception stack trace.
static File getUniqueFile(File oldFile)
          Get unique file object.
static String readFully(InputStream input)
          Read fully from stream
static String readFully(Reader reader)
          Read fully from reader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IoUtils

public IoUtils()
Method Detail

getBufferedInputStream

public static final BufferedInputStream getBufferedInputStream(InputStream in)
Get a BufferedInputStream.


getBufferedOutputStream

public static final BufferedOutputStream getBufferedOutputStream(OutputStream out)
Get a BufferedOutputStream.


getBufferedReader

public static final BufferedReader getBufferedReader(Reader reader)
Get BufferedReader.


getBufferedWriter

public static final BufferedWriter getBufferedWriter(Writer wr)
Get BufferedWriter.


getUniqueFile

public static final File getUniqueFile(File oldFile)
Get unique file object.


close

public static final void close(InputStream is)
No exception InputStream close method.


close

public static final void close(OutputStream os)
No exception OutputStream close method.


close

public static final void close(Reader rd)
No exception java.io.Reader close method.


close

public static final void close(Writer wr)
No exception java.io.Writer close method.


getStackTrace

public static final String getStackTrace(Throwable ex)
Get exception stack trace.


copy

public static final void copy(Reader input,
                              Writer output,
                              int bufferSize)
                       throws IOException
Copy chars from a Reader to a Writer.

Parameters:
bufferSize - Size of internal buffer to use.
Throws:
IOException

copy

public static final void copy(InputStream input,
                              OutputStream output,
                              int bufferSize)
                       throws IOException
Copy chars from a InputStream to a OutputStream .

Parameters:
bufferSize - Size of internal buffer to use.
Throws:
IOException

readFully

public static final String readFully(Reader reader)
                              throws IOException
Read fully from reader

Throws:
IOException

readFully

public static final String readFully(InputStream input)
                              throws IOException
Read fully from stream

Throws:
IOException

delete

public static final void delete(File file)
                         throws IOException
Throws:
IOException


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.