javatools.io
Class FileUtils

java.lang.Object
  |
  +--javatools.io.FileUtils

public class FileUtils
extends java.lang.Object

Contains a set of function useful for files.


Constructor Summary
FileUtils()
          Creates new FileUtils
 
Method Summary
static void deleteFileGroup(java.io.File inFile, java.io.FileFilter filter)
          Deletes all the files contained in directory inFile using filter filter.
static java.io.File getDirectory(java.io.File inFile)
          Returns the container directory for this file.
static java.lang.String getDirectory(java.lang.String inFilePath)
          Returns the containing directory of a file.
static java.lang.String getExtension(java.io.File inFile)
          Returns the extension (the one after the dot...) for a file.
static java.lang.String getExtension(java.lang.String inFilePath)
          Returns the extension for a given path.
static java.lang.String getFileName(java.io.File inFile)
          Returns the file name only from a file.
static java.lang.String getFileName(java.lang.String inFilePath)
          Returns the file name without the complete path.
static java.lang.String getFileNameWithNoExtension(java.io.File inFile)
          Returns the filename with no path and no extension.
static java.lang.String getFileNameWithNoExtension(java.lang.String inFilePath)
          Returns the filename with no path and no extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtils

public FileUtils()
Creates new FileUtils

Method Detail

getDirectory

public static java.io.File getDirectory(java.io.File inFile)
Returns the container directory for this file.

Parameters:
inFile - The file to be used.
Returns:
The container directory.

getDirectory

public static java.lang.String getDirectory(java.lang.String inFilePath)
Returns the containing directory of a file.

Parameters:
inFilePath - The path to the file.
Returns:
The container directory.

getFileName

public static java.lang.String getFileName(java.io.File inFile)
Returns the file name only from a file.

Parameters:
inFile - The file to be used.
Returns:
The file name.

getFileName

public static java.lang.String getFileName(java.lang.String inFilePath)
Returns the file name without the complete path.

Parameters:
inFilePath - The path to the file.
Returns:
The file name.

getExtension

public static java.lang.String getExtension(java.io.File inFile)
Returns the extension (the one after the dot...) for a file.

Parameters:
inFile - The file to be used.
Returns:
The resulting extension (without dot).

getExtension

public static java.lang.String getExtension(java.lang.String inFilePath)
Returns the extension for a given path.

Parameters:
inFilePath - The file path.
Returns:
The resulting extension, without dot.

getFileNameWithNoExtension

public static java.lang.String getFileNameWithNoExtension(java.io.File inFile)
Returns the filename with no path and no extension.

Parameters:
inFile - The file to be used.
Returns:
The filename all alone.

getFileNameWithNoExtension

public static java.lang.String getFileNameWithNoExtension(java.lang.String inFilePath)
Returns the filename with no path and no extension.

Parameters:
inFilePath - The path to the file.
Returns:
The filename all alone.

deleteFileGroup

public static void deleteFileGroup(java.io.File inFile,
                                   java.io.FileFilter filter)
Deletes all the files contained in directory inFile using filter filter.

Parameters:
inFile - The directory in which files will be deleted.
filter - The filter to use.