org.apache.nutch.fs
Class FileUtil

java.lang.Object
  extended byorg.apache.nutch.fs.FileUtil

public class FileUtil
extends Object

A collection of file-processing util methods


Constructor Summary
FileUtil()
           
 
Method Summary
static boolean copyContents(NutchFileSystem nfs, File src, File dst, boolean overwrite)
          Copy a file's contents to a new location.
static boolean fullyDelete(File dir)
          Delete a directory and all its contents.
static boolean fullyDelete(NutchFileSystem nfs, File dir)
           
static void recursiveCopy(NutchFileSystem nfs, File src, File dst)
          Copy a file and/or directory and all its contents (whether data or other files/dirs)
 
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

fullyDelete

public static boolean fullyDelete(File dir)
                           throws IOException
Delete a directory and all its contents. If we return false, the directory may be partially-deleted.

Throws:
IOException

fullyDelete

public static boolean fullyDelete(NutchFileSystem nfs,
                                  File dir)
                           throws IOException
Throws:
IOException

copyContents

public static boolean copyContents(NutchFileSystem nfs,
                                   File src,
                                   File dst,
                                   boolean overwrite)
                            throws IOException
Copy a file's contents to a new location. Returns whether a target file was overwritten

Throws:
IOException

recursiveCopy

public static void recursiveCopy(NutchFileSystem nfs,
                                 File src,
                                 File dst)
                          throws IOException
Copy a file and/or directory and all its contents (whether data or other files/dirs)

Throws:
IOException


Copyright © 2006 The Apache Software Foundation