|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gjt.sp.util.IOUtilities
public class IOUtilities
IO tools that depends on JDK only.
| Method Summary | |
|---|---|
static void |
closeQuietly(java.io.Closeable closeable)
Method that will close an Closeable ignoring it if it is null and ignoring exceptions. |
static void |
closeQuietly(java.io.InputStream in)
Method that will close an InputStream ignoring it if it is null and ignoring exceptions. |
static void |
closeQuietly(java.io.OutputStream out)
Method that will close an OutputStream ignoring it if it is null and ignoring exceptions. |
static void |
closeQuietly(java.io.Reader r)
Method that will close an Reader ignoring it if it is null and ignoring exceptions. |
static void |
closeQuietly(java.io.Writer out)
Method that will close a Writer ignoring it if it is null and ignoring exceptions. |
static boolean |
copyStream(int bufferSize,
ProgressObserver progress,
java.io.InputStream in,
java.io.OutputStream out,
boolean canStop)
Copy an input stream to an output stream. |
static boolean |
copyStream(ProgressObserver progress,
java.io.InputStream in,
java.io.OutputStream out,
boolean canStop)
Copy an input stream to an output stream with a buffer of 4096 bytes. |
static long |
fileLength(java.io.File file)
Returns the length of a file. |
static boolean |
moveFile(java.io.File source,
java.io.File dest)
Moves the source file to the destination. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean moveFile(java.io.File source,
java.io.File dest)
false. Otherwise, the contents of the
source are copied to the destination, the source is deleted,
and true is returned.
source - The source file to move.dest - The destination where to move the file.
public static boolean copyStream(int bufferSize,
ProgressObserver progress,
java.io.InputStream in,
java.io.OutputStream out,
boolean canStop)
throws java.io.IOException
bufferSize - the size of the bufferprogress - the progress observer it could be nullin - the input streamout - the output streamcanStop - if true, the copy can be stopped by interrupting the thread
true if the copy was done, false if it was interrupted
java.io.IOException - IOException If an I/O error occurs
public static boolean copyStream(ProgressObserver progress,
java.io.InputStream in,
java.io.OutputStream out,
boolean canStop)
throws java.io.IOException
progress - the progress observer it could be nullin - the input streamout - the output streamcanStop - if true, the copy can be stopped by interrupting the thread
true if the copy was done, false if it was interrupted
java.io.IOException - IOException If an I/O error occurspublic static long fileLength(java.io.File file)
file - the file or directory
public static void closeQuietly(java.io.InputStream in)
InputStream ignoring it if it is null and ignoring exceptions.
in - the InputStream to close.public static void closeQuietly(java.io.OutputStream out)
OutputStream ignoring it if it is null and ignoring exceptions.
out - the OutputStream to close.public static void closeQuietly(java.io.Reader r)
Reader ignoring it if it is null and ignoring exceptions.
r - the Reader to close.public static void closeQuietly(java.io.Writer out)
Writer ignoring it if it is null and ignoring exceptions.
out - the Writer to close.public static void closeQuietly(java.io.Closeable closeable)
Closeable ignoring it if it is null and ignoring exceptions.
closeable - the closeable to close.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||