org.apache.hadoop.fs
Class FileUtil

java.lang.Object
  extended by org.apache.hadoop.fs.FileUtil

public class FileUtil
extends Object

A collection of file-processing util methods


Constructor Summary
FileUtil()
           
 
Method Summary
static boolean copyContents(FileSystem fs, File src, File dst, boolean overwrite, Configuration conf)
          Copy a file's contents to a new location.
static boolean fullyDelete(File dir, Configuration conf)
          Delete a directory and all its contents.
static boolean fullyDelete(FileSystem fs, File dir)
           
static void recursiveCopy(FileSystem fs, File src, File dst, Configuration conf)
          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,
                                  Configuration conf)
                           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(FileSystem fs,
                                  File dir)
                           throws IOException
Throws:
IOException

copyContents

public static boolean copyContents(FileSystem fs,
                                   File src,
                                   File dst,
                                   boolean overwrite,
                                   Configuration conf)
                            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(FileSystem fs,
                                 File src,
                                 File dst,
                                 Configuration conf)
                          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