com.samskivert.util
Class FileUtil

java.lang.Object
  extended by com.samskivert.util.FileUtil

public class FileUtil
extends Object

Utility methods for files.


Constructor Summary
FileUtil()
           
 
Method Summary
static void recursiveClean(File file)
          Recursively deletes all of the files and directories in the supplied directory, but not the directory itself.
static void recursiveDelete(File file)
          Recursively delete the specified directory and all files and directories underneath it.
protected static void recursiveWipe(File file, boolean wipeMe)
          Helper function.
static String resuffix(File file, String ext, String newext)
          Replaces ext with the supplied new extention if the supplied file path ends in ext.
static boolean unpackJar(JarFile jar, File target)
          Unpacks the specified jar file intto the specified target directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileUtil

public FileUtil()
Method Detail

recursiveDelete

public static void recursiveDelete(File file)
Recursively delete the specified directory and all files and directories underneath it.


recursiveClean

public static void recursiveClean(File file)
Recursively deletes all of the files and directories in the supplied directory, but not the directory itself.


resuffix

public static String resuffix(File file,
                              String ext,
                              String newext)
Replaces ext with the supplied new extention if the supplied file path ends in ext. Otherwise the new extension is appended to the whole existing file path.


unpackJar

public static boolean unpackJar(JarFile jar,
                                File target)
Unpacks the specified jar file intto the specified target directory.

Returns:
true if the jar file was successfully unpacked, false if an error occurred that prevented the unpacking. The error will be logged.

recursiveWipe

protected static void recursiveWipe(File file,
                                    boolean wipeMe)
Helper function.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.