|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.staccatocommons.io.Directory
public class Directory
| Constructor Summary | |
|---|---|
Directory(File file)
Creates a new Directory from a File. |
|
Directory(String pathname)
Creates a new Directory from a pathname |
|
| Method Summary | |
|---|---|
Directory |
clean()
Cleans this directory using FileUtils.cleanDirectory(this.getFile()) |
Directory |
copy(Directory destination)
Copies this directory and its contents to the given destinantion using FileUtils.copyDirectory(file, destination.getFile()) |
String |
getAbsolutePath()
Answers the absolute path of this directory |
Stream<File> |
getBreadthFirstFileStream()
Returns a Stream that retrieves all the non-directory files
contained by this directory or in subdirectories, recursing the directory
tree using a breadth-first algorithm |
Stream<File> |
getDepthFirstFileStream()
Returns a Stream that retrieves all the non-directory files
contained by this directory or in subdirectories, recursing the directory
tree using a depth-first algorithm |
File |
getFile()
Returns the underlying File of this directory |
Stream<File> |
getFileStream()
returns a Stream of the files directly contained by this directory |
Stream<File> |
getRecurseFileStream()
Synonym of getDepthFirstFileStream(). |
long |
size()
Answers Directory size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Directory(@NonNull
String pathname)
Directory from a pathname
pathname - the pathname of the directory. It must point to a directory
public Directory(@NonNull
File file)
Directory from a File.
file - must be a directory| Method Detail |
|---|
@NonNull public String getAbsolutePath()
getFile().getAbsolutePath()File.getAbsolutePath()@NonNull public File getFile()
File of this directory
@NonNull public Stream<File> getFileStream()
Stream of the files directly contained by this directory
File.listFiles()@NonNull public Stream<File> getBreadthFirstFileStream()
Stream that retrieves all the non-directory files
contained by this directory or in subdirectories, recursing the directory
tree using a breadth-first algorithm
Stream.@NonNull public Stream<File> getDepthFirstFileStream()
Stream that retrieves all the non-directory files
contained by this directory or in subdirectories, recursing the directory
tree using a depth-first algorithm
Stream.@NonNull public Stream<File> getRecurseFileStream()
getDepthFirstFileStream(). Prefer this method if
iteration order is not important
getDepthFirstFileStream()public long size()
Directory size.
FileUtils.sizeOfDirectory(this.getFile())FileUtils.sizeOfDirectory(File)
public Directory clean()
throws IOException
FileUtils.cleanDirectory(this.getFile())
IOExceptionFileUtils#cleanDirectory(File)}
public Directory copy(@NonNull
Directory destination)
throws IOException
FileUtils.copyDirectory(file, destination.getFile())
destination - the new directory
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||