abstract class
|
FileSystem
|
extends
|
Disposable
|
||
implements
|
IFileSystem
|
||||
base of
|
HttpFileSystem
|
||||
LocalFileSystem
|
|||||
MemoryFileSystem
|
|||||
VirtualFileSystem
|
Is this object capable of creating new resources?
public
virtual
property
|
CanCreate
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
object
can
create
new
resources,
false
if
it
cannot.
|
||
implements
|
ICanCreateOpenDelete.CanCreate
|
Is this object capable of deleting files?
public
virtual
property
|
CanDelete
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
object
can
delete
resources,
false
if
it
cannot. |
||
implements
|
ICanCreateOpenDelete.CanDelete
|
Is this object capable of opening existing files?
public
virtual
property
|
CanOpen
{
get
}
|
||
type
|
bool
|
||
value
|
true
if
this
object
can
open
existing
resources,
false
if
it
cannot.
|
||
implements
|
ICanCreateOpenDelete.CanOpen
|
Gets or sets the current directory of this filesystem.
public
abstract
property
|
Directory
{
get
set
}
|
||
type
|
Path
|
||
value
|
|
The current directory. | |
implements
|
IFileSystem.Directory
|
Remarks:
The returned directory will always be in canonical form (see Canonical ).
Returns the lifecycle state of this object.
public
virtual
property
|
LifecycleState
{
get
}
|
||
type
|
LifecycleState
|
||
value
|
The lifecycle state. | ||
inherited
|
Disposable.LifecycleState
|
Returns the root nodes of this filesystem.
public
abstract
property
|
Roots
{
get
}
|
||
type
|
Path[]
|
||
value
|
|
The root nodes. | |
implements
|
IFileSystem.Roots
|
Acquires a strong reference to this disposable object.
[OwnerReturn, ThreadSafe]
|
||||
public
method
|
AcquireTry
()
|
|||
type
|
IDisposable
|
|||
returns
|
this
if
a
new
strong
reference
has
been
acquired,
null
if
this
object
is
already
being
disposed.
|
|||
inherited
|
Disposable.AcquireTry
|
Remarks:
The object will not be actually disposed by calls to Dispose when there is at least one strong reference left. Code that calls the AcquireTry method is responsible for calling the Dispose method accordingly.
This method is not intended to be used in performance-critical code. It should only be used to high-level resource management.
Creates the given directory.
public
abstract
method
|
DirectoryCreate
(Path directoryPath)
|
||
params
|
directoryPath
|
[not-null]
|
The directory path. |
implements
|
IFileSystem.DirectoryCreate
|
Remarks:
If the given directory already exists, the method returns silently.
The method will create all ancestor directories if necessary.
Tries to deletes the given directory if it exists.
public
abstract
method
|
DirectoryDelete
(Path directoryPath)
|
||
type
|
bool
|
||
params
|
directoryPath
|
[not-null]
|
The path. |
returns
|
true
if
the
directory
has
been
deleted,
false
if
it
not. |
||
implements
|
IFileSystem.DirectoryDelete
|
Remarks:
A directory can only be deleted if it is empty.
Checks if the given directory exists.
public
abstract
method
|
DirectoryExists
(Path directoryPath)
|
||
type
|
bool
|
||
params
|
directoryPath
|
The directory path. | |
returns
|
true
if
the
directory
exists,
false
if
not. |
||
implements
|
IFileSystem.DirectoryExists
|
Returns the amount of storage space that is available in the given directory.
public
virtual
method
|
DirectoryFreeSpace
(Path directoryPath)
|
||
type
|
int64
|
||
params
|
directoryPath
|
[not-null]
|
The directory path. |
returns
|
|
The available storage space, in bytes. | |
implements
|
IFileSystem.DirectoryFreeSpace
|
Remarks:
If the given directory does not exist, the storage space for the nearest existing ancestor directory is reported.
Releases all resources held by this object if there are no more strong references to it, decrements the reference counter by one otherwise.
[Dispose, OwnerThis, ThreadSafe]
|
||||
public
method
|
Dispose
()
|
|||
inherited
|
Disposable.Dispose
|
Remarks:
The Dispose method silently returns if the object has already been disposed.
Permanently deletes a binary object.
public
abstract
method
|
FileDelete
(Path filePath)
|
||
type
|
bool
|
||
params
|
filePath
|
[not-null]
|
The file path. |
returns
|
true
if
the
binary
object
has
been
deleted,
false
if
it
did
not
exist.
|
||
implements
|
IFileSystem.FileDelete
|
Checks if a binary object exists under the given path.
public
abstract
method
|
FileExists
(Path filePath)
|
||
type
|
bool
|
||
params
|
filePath
|
The path. | |
returns
|
true
if
filePath
points
to
an
existing
binary
object,
false
if
not.
|
||
implements
|
IFileSystem.FileExists
|
Creates a new instance of IFile.
[OwnerReturn]
|
||||
public
abstract
method
|
FileNew
(Path filePath,
FileFlags flags)
|
|||
type
|
IFile
|
|||
params
|
filePath
|
[not-null]
|
The file path. | |
flags
|
The file flags (creation disposition and behaviour flags). | |||
returns
|
|
The created binary object. | ||
implements
|
IFileSystem.FileNew
|
Remarks:
The PathInfo property of the returned IFile will always be in canonical form (see Canonical).
Returns the first FileSystem object instance that owns the given path.
public
static
method
|
From
(Path path)
|
||
type
|
FileSystem
|
||
params
|
path
|
[not-null]
|
The path. |
returns
|
The
FileSystem
or
null . |
Lists all subdirectories in the given directory.
public
abstract
method
|
ListDirectories
(Path directoryPath,
string pattern = null)
|
||
type
|
Path[]
|
||
params
|
directoryPath
|
[not-null]
|
The directory. |
pattern
|
Optional
name
pattern
using
'?'
and
'*'
wildcards.
Defaults
to
null .
|
||
returns
|
|
The list of canonical directory paths. The returned list order has no particular sort order. | |
implements
|
IFileSystem.ListDirectories
|
Remarks:
The returned pathnames are absolute and fully resolved.
See also:
Path.CanonicalLists all files in the given directory.
public
abstract
method
|
ListFiles
(Path directoryPath,
string pattern = null)
|
||
type
|
Path[]
|
||
params
|
directoryPath
|
[not-null]
|
The directory. |
pattern
|
Optional
name
pattern
using
'?'
and
'*'
wildcards.
Defaults
to
null .
|
||
returns
|
|
The list of canonical file paths. The returned list order has no particular sort order. | |
implements
|
IFileSystem.ListFiles
|
Remarks:
The returned pathnames are absolute and fully resolved.
See also:
Path.CanonicalDoes this filesystem own the given path?
public
abstract
method
|
OwnsPath
(Path path)
|
||
type
|
bool
|
||
params
|
path
|
[not-null]
|
The path object. |
returns
|
true
if
this
filesystem
should
be
used
for
the
given
path,
false
if
not.
|
||
implements
|
IFileSystem.OwnsPath
|
protected
constructor
|
FileSystem
()
|
Disposes the managed resources held by a concrete subclass. This method will be called at most once per subclass.
protected
override
method
|
DisposeManaged
()
|
||
overrides
|
Disposable.DisposeManaged
|
Remarks:
This method will only be called when a disposable object is explicitly destroyed by user code calling the Dispose method. It will not be called when the object is collected as garbage by the system.
Overriding methods must call the DisposeManaged method of their base class. The base call should be the last statement.
The DisposeManaged method is called before the DisposeUnmanaged method.
Disposes the unmanaged resources held by a concrete subclass. This method will be called exactly once per subclass.
protected
virtual
method
|
DisposeUnmanaged
()
|
||
inherited
|
Disposable.DisposeUnmanaged
|
Remarks:
Overriding methods must call the DisposeUnmanaged method of their base class. The base call should be the last statement.
The DisposeUnmanaged method is called after the DisposeManaged method.