info.informatica.io
Class Dir

java.lang.Object
  extended by info.informatica.io.Dir

public final class Dir
extends Object

Wildcard-enabled directory utility.

Mainly useful as a WildcardFilter demonstration.

Example of usage: java -cp jclf.jar info.informatica.io.Dir "/etc/h*"

Version:
1.06
Author:
amengual at informatica dot info

Nested Class Summary
static interface Dir.FilterListener
           
 
Constructor Summary
Dir()
           
 
Method Summary
static String baseName(String path)
          Gets the basename of the path.
static boolean copyFile(File in, File dest, boolean force)
           
static boolean deepCopy(File in, File destDir)
           
static boolean deleteRecursive(File path)
           
static void main(String[] args)
           
 int wildcardFilter(String wildcardPath, Dir.FilterListener listener)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Dir

public Dir()
Method Detail

main

public static void main(String[] args)

baseName

public static String baseName(String path)
Gets the basename of the path.

If the path corresponds to a file, returns the path to parent directory, or null if there isn't, otherwise returns itself (as absolute path)

Parameters:
path - the path
Returns:
the basename, or null if there isn't

wildcardFilter

public int wildcardFilter(String wildcardPath,
                          Dir.FilterListener listener)
                   throws FileFilteringException,
                          IOException
Throws:
FileFilteringException
IOException

copyFile

public static boolean copyFile(File in,
                               File dest,
                               boolean force)

deepCopy

public static boolean deepCopy(File in,
                               File destDir)

deleteRecursive

public static boolean deleteRecursive(File path)