public class FileSystem
extends java.lang.Object
Standard file creating and deleting class. This class lets the user create a file system, consisting of files and/or directories.
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.io.File,java.lang.Boolean> |
archieve
private Map |
| Constructor and Description |
|---|
FileSystem()
Creates a new instance of
FileSystem. |
| Modifier and Type | Method and Description |
|---|---|
private FileSystem |
add(java.io.File file,
boolean isDirectory)
Adds a file or directory to the file system.
|
FileSystem |
addDirectory(java.io.File dir)
Adds a directory to the file system.
|
FileSystem |
addDirectory(java.lang.String path)
Adds a directory to the file system.
|
FileSystem |
addFile(java.io.File file)
Adds a file to the file system.
|
FileSystem |
addFile(java.lang.String path)
Adds a file to the file system.
|
FileSystem |
addTempFile(java.io.File file)
Adds a temporary file to the file system.
|
FileSystem |
addTempFile(java.lang.String path)
Adds a temporary file to the file system.
|
FileSystem |
check()
Checks if all directories needed are in this file system.
|
boolean |
contains(java.io.File file)
Returns whether a file or directory is already in this file system or not.
|
boolean |
contains(java.lang.String path)
Returns whether a file or directory is already in this file system or not.
|
FileSystem |
create()
Creates all files not already existing in this file system.
|
FileSystem |
destroy()
Deletes all files existing in this file system.
|
static void |
main(java.lang.String[] args) |
FileSystem |
print()
Prints all entries of this file system.
|
private java.util.Map<java.io.File,java.lang.Boolean> archieve
private Map archieve = null; private FileSystem add(java.io.File file, boolean isDirectory)
file - the file or directory to be added.isDirectory - use true if the given File instance is a directory, use false if not.public FileSystem addTempFile(java.lang.String path)
path - the path of the file to be added.public FileSystem addTempFile(java.io.File file)
file - the File instance to be added.public FileSystem addFile(java.lang.String path)
path - the path of the file to be added.public FileSystem addFile(java.io.File file)
file - the File instance to be added.public FileSystem addDirectory(java.lang.String path)
path - the path of the file to be added.public FileSystem addDirectory(java.io.File dir)
dir - the File instance to be added.public boolean contains(java.io.File file)
file - true if the file is contained, false if not.public boolean contains(java.lang.String path)
path - true if the file is contained, false if not.public FileSystem create() throws java.io.IOException
java.io.IOException - If an I/O error occurred.public FileSystem destroy() throws java.io.IOException
java.io.IOException - If an I/O error occurredpublic FileSystem check()
public FileSystem print()
public static void main(java.lang.String[] args)