org.springframework.roo.support.util
Class FileUtils

java.lang.Object
  extended by org.springframework.roo.support.util.FileUtils

public abstract class FileUtils
extends Object

Utilities for handling File instances.

Since:
1.0
Author:
Ben Alex

Constructor Summary
FileUtils()
           
 
Method Summary
static boolean copyRecursively(File source, File destination, boolean deleteDestinationOnExit)
          Copies the specified source directory to the destination.
static boolean deleteRecursively(File file)
          Deletes the specified File.
 
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

deleteRecursively

public static final boolean deleteRecursively(File file)
Deletes the specified File.

If the File refers to a directory, any contents of that directory (including other directories) are also deleted.

If the File does not already exist, this method immediately returns true.

Parameters:
file - to delete (required; the file may or may not exist)
Returns:
true if the file is fully deleted, or false if there was a failure when deleting

copyRecursively

public static final boolean copyRecursively(File source,
                                            File destination,
                                            boolean deleteDestinationOnExit)
Copies the specified source directory to the destination.

Both the source must exist. If the destination does not already exist, it will be created. If the destination does exist, it must be a directory (not a file).

Parameters:
source - the already-existing source directory (required)
destination - the destination directory (required)
deleteDestinationOnExit - indicates whether to mark any created destinations for deletion on exit
Returns:
true if the copy was successful


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.