| java.lang.Object org.gjt.sp.util.IOUtilities
IOUtilities | public class IOUtilities (Code) | | IO tools that depends on JDK only.
author: Matthieu Casanova version: $Id: IOUtilities.java 9728 2007-06-09 02:00:10Z Vampire0 $ since: 4.3pre5 |
closeQuietly | public static void closeQuietly(InputStream in)(Code) | | Method that will close an
InputStream ignoring it if it is null and ignoring exceptions.
Parameters: in - the InputStream to close. |
closeQuietly | public static void closeQuietly(OutputStream out)(Code) | | Method that will close an
OutputStream ignoring it if it is null and ignoring exceptions.
Parameters: out - the OutputStream to close. |
closeQuietly | public static void closeQuietly(Reader r)(Code) | | Method that will close an
Reader ignoring it if it is null and ignoring exceptions.
Parameters: r - the Reader to close. since: jEdit 4.3pre5 |
closeQuietly | public static void closeQuietly(Closeable closeable)(Code) | | Method that will close an
java.io.Closeable ignoring it if it is null and ignoring exceptions.
Parameters: closeable - the closeable to close. since: jEdit 4.3pre8 |
copyStream | public static boolean copyStream(int bufferSize, ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException(Code) | | Copy an input stream to an output stream.
Parameters: bufferSize - the size of the buffer Parameters: progress - the progress observer it could be null Parameters: in - the input stream Parameters: out - the output stream Parameters: canStop - if true, the copy can be stopped by interrupting the thread true if the copy was done, false if it was interrupted throws: IOException - IOException If an I/O error occurs |
copyStream | public static boolean copyStream(ProgressObserver progress, InputStream in, OutputStream out, boolean canStop) throws IOException(Code) | | Copy an input stream to an output stream with a buffer of 4096 bytes.
Parameters: progress - the progress observer it could be null Parameters: in - the input stream Parameters: out - the output stream Parameters: canStop - if true, the copy can be stopped by interrupting the thread true if the copy was done, false if it was interrupted throws: IOException - IOException If an I/O error occurs |
fileLength | public static long fileLength(File file)(Code) | | Returns the length of a file. If it is a directory it will calculate recursively the length.
Parameters: file - the file or directory the length of the file or directory. If the file doesn't exists it will return 0 since: 4.3pre10 |
moveFile | public static boolean moveFile(File source, File dest)(Code) | | Moves the source file to the destination.
If the destination cannot be created or is a read-only file, the
method returns false . Otherwise, the contents of the
source are copied to the destination, the source is deleted,
and true is returned.
Parameters: source - The source file to move. Parameters: dest - The destination where to move the file. true on success, false otherwise. since: jEdit 4.3pre9 |
|
|