A directory (a.k.a. folder), as defined by the underlying file system.
Parent Class
Parent Interfaces
Type | Name | Signature |
---|---|---|
constructor | Directory | public Directory(string) |
method | create | public bool create() |
method | delete | public bool delete() |
method | exists | public bool exists() |
method | getChild | public Item getChild(string) |
method | getName | public String getName() |
method | getParent | public Directory getParent() |
method | getPath | public String getPath() |
method | isFile | public bool isFile() |
method | listAll | public Item[] listAll() |
method | move | public bool move(System.IO.Directory) |
method | rename | public bool rename(string) |
method | subDirectory | public Directory subDirectory(string) |
method | subFile | public File subFile(string) |
public Directory(string path)
Create a new directory with the specified path.
Parameters
public bool create()
Create a directory represented by this object.
Required Policies
System.IO/write
Returns
Throws
public bool delete()
Delete this directory recursively.
This operation is not transactional. If an exception is thrown during the call some items may have been deleted.
Required Policies
System.IO/write
Returns
Throws
public bool exists()
Whether this directory exist on file system.
Required Policies
System.IO/stat
Returns
public Item getChild(string name)
Get the immediate child with the specified name.
Required Policies
System.IO/list
Parameters
Returns
Throws
public String getName()
Get the name of this directory. This is only the simple name (with extension part) under the path.
Required Policies
System.IO/stat
Returns
public Directory getParent()
Get the directory this directory resides in.
Required Policies
System.IO/stat
Returns
Throws
public String getPath()
Get the absolute path of this directory, including the name.
Required Policies
System.IO/stat
Returns
public bool isFile()
Return false.
Returns
public Item[] listAll()
List all items directly under this directory.
Required Policies
System.IO/list
Returns
public bool move(Directory newDir)
(INHERITED DOC)
Move this item to another directory.
Unlike a few file systems where the move command/API serves dual purpose, Julian splits the semantics between move and rename. Rename operation is only for renaming without moving around the file, while this method may only be used to move an item from one directory to another without changing its name. The obvious implication of this division is that for the move operation, the destination must be a valid directory, and there must be no item in that directory that is already possessing the same name. In any of these cases this method returns false. Moving to the same directory is allowed and implemented trivially by returning true directly.
To move an item and change its name, use extension method relocate().
Required Policies
System.IO/write
Parameters
Returns
public bool rename(string newName)
(INHERITED DOC)
Rename this item while remaining in the same directory.
Unlike a few file systems where the move command/API serves dual purpose, Julian splits the semantics between move and rename. Move operation may only be used to move an item from one directory to another without changing its name, while this method is only for renaming without moving around the file. The obvious implication of this division is that for the rename operation, the new name must not contain file system separator, and there must be no item within the same directory that is already possessing the same name. In any of these cases this method returns false.
To move an item and change its name, use extension method relocate().
Required Policies
System.IO/write
Parameters
Returns
public Directory subDirectory(string path)
Create a Directory instance representing the child item with the specified path.
The resultant item is merely a handle and may not exist.
Parameters
Returns
Throws
public File subFile(string path)
Create a File instance representing the child item with the specified path.
The resultant item is merely a handle and may not exist.
Parameters
Returns
Throws