org.apache.ftpserver.util
Class IoUtils

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

public class IoUtils
extends java.lang.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.

Version:
$Rev: 711534 $, $Date: 2008-11-05 09:48:47 +0100 (Wed, 05 Nov 2008) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
IoUtils()
           
 
Method Summary
static void close(java.io.InputStream is)
          No exception InputStream close method.
static void close(java.io.OutputStream os)
          No exception OutputStream close method.
static void close(java.io.Reader rd)
          No exception java.io.Reader close method.
static void close(java.io.Writer wr)
          No exception java.io.Writer close method.
static void copy(java.io.InputStream input, java.io.OutputStream output, int bufferSize)
          Copy chars from a InputStream to a OutputStream .
static void copy(java.io.Reader input, java.io.Writer output, int bufferSize)
          Copy chars from a Reader to a Writer.
static void delete(java.io.File file)
           
static java.io.BufferedInputStream getBufferedInputStream(java.io.InputStream in)
          Get a BufferedInputStream.
static java.io.BufferedOutputStream getBufferedOutputStream(java.io.OutputStream out)
          Get a BufferedOutputStream.
static java.io.BufferedReader getBufferedReader(java.io.Reader reader)
          Get BufferedReader.
static java.io.BufferedWriter getBufferedWriter(java.io.Writer wr)
          Get BufferedWriter.
static java.lang.String getStackTrace(java.lang.Throwable ex)
          Get exception stack trace.
static java.io.File getUniqueFile(java.io.File oldFile)
          Get unique file object.
static java.lang.String readFully(java.io.InputStream input)
          Read fully from stream
static java.lang.String readFully(java.io.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 java.io.BufferedInputStream getBufferedInputStream(java.io.InputStream in)
Get a BufferedInputStream.


getBufferedOutputStream

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


getBufferedReader

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


getBufferedWriter

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


getUniqueFile

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


close

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


close

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


close

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


close

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


getStackTrace

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


copy

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

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

copy

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

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

readFully

public static final java.lang.String readFully(java.io.Reader reader)
                                        throws java.io.IOException
Read fully from reader

Throws:
java.io.IOException

readFully

public static final java.lang.String readFully(java.io.InputStream input)
                                        throws java.io.IOException
Read fully from stream

Throws:
java.io.IOException

delete

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


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