Back to Fresco

FileTree

docs/javadoc/reference/com/facebook/common/file/FileTree.html

3.6.012.4 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Exceptions

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public class

FileTree

extends Object

| java.lang.Object | | ↳ | com.facebook.common.file.FileTree |

Class Overview

Utility class to visit a file tree. There's similar functionality in Java 7's Files.walkFileTree method. Its methods could be merge into FileUtil (although it seems to have a lot of crazy redundant methods, maybe for testing, but crazy anyway).

Summary

Public Constructors
Public Methods
static boolean
Deletes all files and subdirectories in directory (doesn't delete the directory passed as parameter).
static boolean
Deletes the file and if it's a directory deletes also any content in it
static void
Iterates over the file tree of a directory.

| [Expand] Inherited Methods | | --- | | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

|

Public Constructors

public FileTree()

Public Methods

public static boolean deleteContents(File directory)

Deletes all files and subdirectories in directory (doesn't delete the directory passed as parameter).

public static boolean deleteRecursively(File file)

Deletes the file and if it's a directory deletes also any content in it

Parameters

| file | a file or directory |

Returns
  • true if the file/directory could be deleted

public static void walkFileTree(File directory, FileTreeVisitor visitor)

Iterates over the file tree of a directory. It receives a visitor and will call its methods for each file in the directory. preVisitDirectory (directory) visitFile (file) - recursively the same for every subdirectory postVisitDirectory (directory)

Parameters

| directory | the directory to iterate | | visitor | the visitor that will be invoked for each directory/file in the tree |

+Generated by Doclava. +