Skip to main content
Version: 3.5

IFileSystemProvider

Namespace: Wisej.Core

Assembly: Wisej.Framework (3.5.0.0)

Abstracts access to the file system. Implementations of this interface are used by the file dialogs and other components that need to interact with the file system. Wisej provides the built-in default implementation for the standard disk-based file system and a number of alternative implementations in the Wisej extensions, such as: Amazon S3, Google Drive, and Microsoft OneDrive.

public interface IFileSystemProvider

Properties

Instance memberIcon

Image: Returns or sets the icon that represents the file system.

Instance memberIconSource

String: Returns or sets the icon name or URL that represents the file system.

Instance memberName

String: Returns or sets the name of this root. This is the name that should be shown to the user.

Instance memberRoot

String: Returns or sets the root path for the file system. All file system operations in the implementation class are expected to be limited to the root.

Methods

Instance memberContains(path)

Checks whether the specified path starts with the Name of this file system provider.

ParameterTypeDescription
pathStringPath of the file to check.

Returns: Boolean. True if the specified path starts with the name of this file system provider.

Instance memberCreateDirectory(path)

Creates the specified directory and sub-directories.

ParameterTypeDescription
pathStringPath of the directory to create.

Instance memberDeleteDirectory(path, recursive)

Deletes the specified directory and, optionally, sub-directories.

ParameterTypeDescription
pathStringPath of the directory to delete.
recursiveBooleanIndicates whether to delete sub directories.

Instance memberDeleteFile(path)

Deletes the specified file.

ParameterTypeDescription
pathStringPath of the file to delete.

Instance memberExists(path)

Returns whether the specified file or directory exists.

ParameterTypeDescription
pathStringPath of the file or directory to check.

Returns: Boolean. True of the file or directory exists.

Instance memberGetAttributes(path)

Returns the FileAttributes for the specified path .

ParameterTypeDescription
pathStringFile path for which to retrieve the FileAttributes.

Returns: FileAttributes. An instance of FileAttributes with the relevant flags set.

Instance memberGetCreationTime(path)

Returns the file's creation time.

ParameterTypeDescription
pathStringPath of the file to query.

Returns: DateTime. A DateTime representing the timestamp of the file creation.

Instance memberGetDirectories(path, pattern, searchOption)

Returns a list of directory paths that match the pattern and search options in the specified path.

ParameterTypeDescription
pathStringPath to search into.
patternStringWild card pattern to match.
searchOption optionalSearchOptionOne of the SearchOption options.

Returns: String[]. A Array containing the full path of the directories that match the search pattern and search options.

Instance memberGetFiles(path, pattern, searchOption)

Returns a list of file paths that match the pattern and search options in the specified path.

ParameterTypeDescription
pathStringPath to search into.
patternStringWild card pattern to match.
searchOption optionalSearchOptionOne of the SearchOption options.

Returns: String[]. A Array containing the full path of the files that match the search pattern and search options.

Instance memberGetFileSize(path)

Returns the size of the file.

ParameterTypeDescription
pathStringPath of the file to query.

Returns: Int64. The size of the file in bytes.

Instance memberGetLastWriteTime(path)

Returns the last write timestamp for the specified file.

ParameterTypeDescription
pathStringPath of the file to query.

Returns: DateTime. A DateTime representing the timestamp of the last time the file was written.

Instance memberMapPath(path)

Maps the virtual path to the corresponding physical path on the specific IFileSystemProvider implementation.

ParameterTypeDescription
pathStringVirtual path to map to the corresponding physical path.

Returns: String. The physical path for the IFileSystemProvider implementation.

Instance memberOpenFileStream(path, mode, access)

Opens the specified file for reading or writing.

ParameterTypeDescription
pathStringThe path of the file to open.
modeFileModeSpecified if the file should be opened, created, overwritten or truncated.
accessFileAccessSpecified if the stream should be opened for reading or writing.

Returns: Stream. A Stream that can be used to read or write the content of the file.

Instance memberRenameDirectory(path, newName)

Renames the specified directory.

ParameterTypeDescription
pathStringPath of the directory to rename.
newNameStringThe new directory name.

Instance memberRenameFile(path, newName)

Renames the specified file.

ParameterTypeDescription
pathStringPath of the file to rename.
newNameStringThe new file name.

Implemented By

NameDescription
FileSystemProviderDefault implementation of IFileSystemProvider. Provides access to the server's file system.