public class

FileUtils

extends Object
java.lang.Object
   ↳ com.facebook.common.file.FileUtils

Class Overview

Static operations on Files

Summary

Nested Classes
class FileUtils.CreateDirectoryException Represents an exception during directory creation  
class FileUtils.FileDeleteException Represents an exception when the target file/directory cannot be deleted  
class FileUtils.ParentDirNotFoundException A specialization of FileNotFoundException when the parent-dir doesn't exist  
class FileUtils.RenameException Represents an unknown rename exception  
Public Constructors
FileUtils()
Public Methods
static void mkdirs(File directory)
Creates the specified directory, along with all parent paths if necessary
static void rename(File source, File target)
Renames the source file to the target file.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public FileUtils ()

Public Methods

public static void mkdirs (File directory)

Creates the specified directory, along with all parent paths if necessary

Parameters
directory directory to be created

public static void rename (File source, File target)

Renames the source file to the target file. If the target file exists, then we attempt to delete it. If the delete or the rename operation fails, then we raise an exception

Parameters
source the source file
target the new 'name' for the source file
Throws
IOException
FileUtils.RenameException