de.javasoft.io
Class FileUtils

java.lang.Object
  extended by de.javasoft.io.FileUtils

public class FileUtils
extends java.lang.Object

Usefull file utilities.

Version:
1.02, 10.06.2005

Constructor Summary
FileUtils()
           
 
Method Summary
static boolean copy(java.io.File source, java.io.File destination, boolean recursive, boolean replaceAll, boolean move, FileOperationListener listener)
          Copy a file or directory to the specified destination.
static boolean copy(java.io.File source, java.io.File destination, boolean preserveTimestamp, boolean move, FileOperationListener listener)
          Copy a single file to the specified destination.
static boolean delete(java.io.File file, boolean recursive, FileOperationListener listener)
          Copy a single file to the specified destination.
static boolean determineProperties(FileProperties props, java.io.File file, boolean recursive, FileOperationListener listener)
          Determine file properties of the specified file or directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Method Detail

delete

public static boolean delete(java.io.File file,
                             boolean recursive,
                             FileOperationListener listener)
Copy a single file to the specified destination. In case destination file already exists, destination will be overwritten. If destination does not exist, destination file will be created.

Parameters:
file - File or folder to delete.
recursive - True to delete recursive.
listener - A single listener for this file operation.
Returns:
True - means operation not aborted.

copy

public static boolean copy(java.io.File source,
                           java.io.File destination,
                           boolean preserveTimestamp,
                           boolean move,
                           FileOperationListener listener)
                    throws java.io.FileNotFoundException,
                           java.io.IOException
Copy a single file to the specified destination. In case destination file already exists, destination will be overwritten. If destination does not exist, destination file will be created.

Parameters:
source - Source file.
destination - Destination file.
preserveTimestamp - Set last modified timestamp of destination file to lastModified timestamp of source file.
move - Delete source file after copy.
listener - A single listener for this file operation.
Returns:
True - operation not aborted.
Throws:
java.io.FileNotFoundException
java.io.IOException

copy

public static boolean copy(java.io.File source,
                           java.io.File destination,
                           boolean recursive,
                           boolean replaceAll,
                           boolean move,
                           FileOperationListener listener)
                    throws java.io.IOException
Copy a file or directory to the specified destination.

Parameters:
source - Source file.
destination - Destination file.
recursive - Deep copy in case source is directory.
replaceAll - True - replace all existing files; false - replace only older files.
move - Delete source file after copy.
listener - A single listener for this file operation.
Returns:
True - operation not aborted.
Throws:
java.io.IOException

determineProperties

public static boolean determineProperties(FileProperties props,
                                          java.io.File file,
                                          boolean recursive,
                                          FileOperationListener listener)
                                   throws java.io.IOException
Determine file properties of the specified file or directory.

Parameters:
props - Target properties object.
file - Source file
recursive - Can be set in case file is directory.
listener - A single listener for this file operation.
Returns:
True - operation not aborted.
Throws:
java.io.IOException


Copyright © 2004-2011 Jyloo Software. All Rights Reserved.