Save This Page
Home » hadoop-0.14.4 » org.apache » hadoop » fs » [javadoc | source]
org.apache.hadoop.fs
public class: FileUtil [javadoc | source]
java.lang.Object
   org.apache.hadoop.fs.FileUtil
A collection of file-processing util methods
Nested Class Summary:
public static class  FileUtil.HardLink  Class for creating hardlinks. Supports Unix, Cygwin, WindXP. 
Method from org.apache.hadoop.fs.FileUtil Summary:
chmod,   closeSocket,   closeStream,   copy,   copy,   copy,   copyMerge,   createLocalTempFile,   fullyDelete,   fullyDelete,   getDU,   makeShellPath,   makeShellPath,   readFully,   skipFully,   symLink,   unZip
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.hadoop.fs.FileUtil Detail:
 public static int chmod(String filename,
    String perm) throws IOException, InterruptedException 
    Change the permissions on a filename.
 public static  void closeSocket(Socket sock) 
 public static  void closeStream(Closeable closeable) 
 public static boolean copy(File src,
    FileSystem dstFS,
    Path dst,
    boolean deleteSource,
    Configuration conf) throws IOException 
    Copy local files to a FileSystem.
 public static boolean copy(FileSystem srcFS,
    Path src,
    File dst,
    boolean deleteSource,
    Configuration conf) throws IOException 
    Copy FileSystem files to local files.
 public static boolean copy(FileSystem srcFS,
    Path src,
    FileSystem dstFS,
    Path dst,
    boolean deleteSource,
    Configuration conf) throws IOException 
    Copy files between FileSystems.
 public static boolean copyMerge(FileSystem srcFS,
    Path srcDir,
    FileSystem dstFS,
    Path dstFile,
    boolean deleteSource,
    Configuration conf,
    String addString) throws IOException 
    Copy all files in a directory to one output file (merge).
 public static final File createLocalTempFile(File basefile,
    String prefix,
    boolean isDeleteOnExit) throws IOException 
    Create a tmp file for a base file.
 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.
 public static  void fullyDelete(FileSystem fs,
    Path dir) throws IOException 
    Recursively delete a directory.
 public static long getDU(File dir) 
    Takes an input dir and returns the du on that local directory. Very basic implementation.
 public static String makeShellPath(String filename) throws IOException 
    Convert a os-native filename to a path that works for the shell.
 public static String makeShellPath(File file) throws IOException 
    Convert a os-native filename to a path that works for the shell.
 public static  void readFully(InputStream in,
    byte[] buf,
    int off,
    int len) throws IOException 
 public static  void skipFully(InputStream in,
    long len) throws IOException 
 public static int symLink(String target,
    String linkname) throws IOException 
    Create a soft link between a src and destination only on a local disk. HDFS does not support this
 public static  void unZip(File inFile,
    File unzipDir) throws IOException 
    Given a File input it will unzip the file in a the unzip directory passed as the second parameter