net.sourceforge.jaulp.file.delete
Class DeleteFileUtils

java.lang.Object
  extended by net.sourceforge.jaulp.file.delete.DeleteFileUtils

public class DeleteFileUtils
extends java.lang.Object

The Class DeleteFileUtils helps you delete files.

Version:
1.0
Author:
Asterios Raptis

Constructor Summary
DeleteFileUtils()
           
 
Method Summary
static java.lang.Exception checkFile(java.io.File file)
          Checks the File if it is a directory or if its exists or if it is empty.
static void deleleFiles(java.io.File file)
          Tries to delete all files in the Directory.
static void delete(java.io.File file)
          Tries to delete a file and if its a directory than its deletes all the sub-directories.
static void deleteAllFiles(java.io.File file)
          Deletes the File and if it is an directory it deletes his sub-directories recursively.
static void deleteAllFilesWithSuffix(java.io.File file, java.lang.String theSuffix)
          Deletes all files with the given suffix recursively.
static void deleteFile(java.io.File fileToDelete)
          Tries to delete the given file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DeleteFileUtils

public DeleteFileUtils()
Method Detail

checkFile

public static java.lang.Exception checkFile(java.io.File file)
Checks the File if it is a directory or if its exists or if it is empty.

Parameters:
file - The File to check.
Returns:
Null if nothing is wrong otherwise an Exception.

deleleFiles

public static void deleleFiles(java.io.File file)
                        throws java.io.IOException
Tries to delete all files in the Directory.

Parameters:
file - The Directory to delete files.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

delete

public static void delete(java.io.File file)
                   throws java.io.IOException
Tries to delete a file and if its a directory than its deletes all the sub-directories.

Parameters:
file - The File to delete.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

deleteAllFiles

public static void deleteAllFiles(java.io.File file)
                           throws java.io.IOException
Deletes the File and if it is an directory it deletes his sub-directories recursively.

Parameters:
file - The File to delete.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

deleteAllFilesWithSuffix

public static void deleteAllFilesWithSuffix(java.io.File file,
                                            java.lang.String theSuffix)
                                     throws java.io.IOException
Deletes all files with the given suffix recursively.

Parameters:
file - The directory from where to delete the files wiht the given suffix.
theSuffix - The suffix from the files to delete.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

deleteFile

public static void deleteFile(java.io.File fileToDelete)
                       throws java.io.IOException
Tries to delete the given file.

Parameters:
fileToDelete - The file to delete.
Throws:
java.io.IOException - Signals that an I/O exception has occurred.


Copyright © 2010. All Rights Reserved.