it.geosolutions.tools.io.file
Class Remove

java.lang.Object
  extended by it.geosolutions.tools.io.file.Remove

public abstract class Remove
extends Object


Constructor Summary
Remove()
           
 
Method Summary
static boolean deleteDirectory(File sourceDirectory, FilenameFilter filter, boolean recursive, boolean deleteItself)
          Delete all the files/dirs with matching the specified FilenameFilter in the specified directory.
static Object deleteFile(File file)
          Delete asynchronously the specified File.
static boolean emptyDirectory(File sourceDirectory, boolean recursive, boolean deleteItself)
          Empty the specified directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Remove

public Remove()
Method Detail

deleteDirectory

public static boolean deleteDirectory(File sourceDirectory,
                                      FilenameFilter filter,
                                      boolean recursive,
                                      boolean deleteItself)
Delete all the files/dirs with matching the specified FilenameFilter in the specified directory. The method can work recursively.

Parameters:
sourceDirectory - the directory to delete files from.
filter - the FilenameFilter to use for selecting files to delete.
recursive - boolean that specifies if we want to delete files recursively or not.
Returns:

deleteFile

public static Object deleteFile(File file)
Delete asynchronously the specified File.


emptyDirectory

public static boolean emptyDirectory(File sourceDirectory,
                                     boolean recursive,
                                     boolean deleteItself)
Empty the specified directory. The method can work recursively.

Parameters:
sourceDirectory - the directory to delete files/dirs from.
recursive - boolean that specifies if we want to delete files/dirs recursively or not.
deleteItself - boolean used if we want to delete the sourceDirectory itself
Returns:


Copyright © 2011-2012 GeoSolutions. All Rights Reserved.