New to Telerik UI for ASP.NET AJAX? Start a free 30-day trial

Provides a file system-based implementation of the FileBrowserContentProvider for managing files and directories.

Definition

Constructors

Initializes a new instance of the FileSystemContentProvider class for managing files and directories in the file system.

C#
[SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
public FileSystemContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
Parameters:contextHttpContext

The current HTTP context.

searchPatternsstring[]

Search patterns for files (supports wildcards).

viewPathsstring[]

Paths to be displayed in the file browser.

uploadPathsstring[]

Paths that allow uploading files.

deletePathsstring[]

Paths that allow deleting files or directories.

selectedUrlstring

The selected URL in the file browser.

selectedItemTagstring

The selected tag in the file browser.

Properties

Gets a value indicating whether the content provider can create directories.

C#
public override bool CanCreateDirectory { get; }

Overrides: FileBrowserContentProvider.CanCreateDirectory

Methods

Determines whether deleting is allowed for the specified path.

C#
protected bool CanDelete(string path)
Parameters:pathstring

The path to check.

Returns:

bool

True if deleting is allowed; otherwise, false.

Determines whether uploading is allowed for the specified path.

C#
protected bool CanUpload(string path)
Parameters:pathstring

The path to check.

Returns:

bool

True if uploading is allowed; otherwise, false.

Copies a directory from one virtual path to another.

C#
public override string CopyDirectory(string path, string newPath)
Parameters:pathstring

The source virtual path of the directory.

newPathstring

The destination virtual path for the directory.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.CopyDirectory(string, string)

Copies a file from one virtual path to another.

C#
public override string CopyFile(string path, string newPath)
Parameters:pathstring

The source virtual path of the file.

newPathstring

The destination virtual path for the file.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.CopyFile(string, string)

Creates a new directory at the specified path with the given name.

C#
public override string CreateDirectory(string path, string name)
Parameters:pathstring

The path where the directory will be created.

namestring

The name of the new directory.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.CreateDirectory(string, string)

Deletes the directory at the specified virtual path.

C#
public override string DeleteDirectory(string path)
Parameters:pathstring

The virtual path of the directory to delete.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.DeleteDirectory(string)

Deletes the file at the specified virtual path.

C#
public override string DeleteFile(string path)
Parameters:pathstring

The virtual path of the file to delete.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.DeleteFile(string)

Converts a virtual path to its absolute path based on the current application context.

C#
protected virtual string GetAbsolutePath(string path)
Parameters:pathstring

The virtual path to convert.

Returns:

string

The absolute path.

Gets a read-only stream for accessing the file at the specified URL.

C#
public override Stream GetFile(string url)
Parameters:urlstring

The URL of the file.

Returns:

Stream

A Stream for reading the file contents.

Overrides: FileBrowserContentProvider.GetFile(string)

Gets the file name from the specified URL.

C#
public override string GetFileName(string url)
Parameters:urlstring

The URL of the file.

Returns:

string

The file name extracted from the URL.

Overrides: FileBrowserContentProvider.GetFileName(string)

Gets the virtual path of the item from the specified URL.

C#
public override string GetPath(string url)
Parameters:urlstring

The URL of the item.

Returns:

string

The virtual path of the item.

Overrides: FileBrowserContentProvider.GetPath(string)

Gets the permissions for the specified path based on upload and delete paths.

C#
protected PathPermissions GetPermissions(string path)
Parameters:pathstring

The path to check permissions for.

Returns:

PathPermissions

The permissions for the path.

Checks whether the given folder path is one of the DeletePaths.

C#
protected bool IsInDeletePaths(string folderPath)
Parameters:folderPathstring

The folder path to check.

Returns:

bool

True if the path is one of the DeletePaths.

Determines whether the specified virtual parent path is a parent of the virtual child path.

C#
protected static bool IsParentOf(string virtualParent, string virtualChild)
Parameters:virtualParentstring

The parent virtual path.

virtualChildstring

The child virtual path.

Returns:

bool

True if the parent is a parent of the child; otherwise, false.

Determines whether the specified directory is valid for inclusion in the file browser.

C#
protected virtual bool IsValid(DirectoryInfo directory)
Parameters:directoryDirectoryInfo

The directory to validate.

Returns:

bool

True if the directory is valid; otherwise, false.

Determines whether the specified file is valid for inclusion in the file browser.

C#
protected virtual bool IsValid(FileInfo file)
Parameters:fileFileInfo

The file to validate.

Returns:

bool

Converts a virtual path to a physical path using the current server context.

C#
protected virtual string MapPath(string path)
Parameters:pathstring

The virtual path to convert.

Returns:

string

The physical path.

Moves a directory from one virtual path to another.

C#
public override string MoveDirectory(string path, string newPath)
Parameters:pathstring

The current virtual path of the directory.

newPathstring

The new virtual path for the directory.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.MoveDirectory(string, string)

Moves a file from one virtual path to another.

C#
public override string MoveFile(string path, string newPath)
Parameters:pathstring

The current virtual path of the file.

newPathstring

The new virtual path for the file.

Returns:

string

An empty string if successful, otherwise an error message.

Overrides: FileBrowserContentProvider.MoveFile(string, string)

Processes the specified array of paths, converting each to its absolute path.

C#
public void ProcessPaths(string[] paths)
Parameters:pathsstring[]

The array of paths to process.

Resolves the specified directory and returns its contents.

C#
public override DirectoryItem ResolveDirectory(string path)
Parameters:pathstring

The virtual path of the directory.

Returns:

DirectoryItem

A DirectoryItem containing the files in the directory.

Overrides: FileBrowserContentProvider.ResolveDirectory(string)

Resolves the root directory as a tree structure for the specified virtual path.

C#
public override DirectoryItem ResolveRootDirectoryAsTree(string path)
Parameters:pathstring

The virtual path of the root directory.

Returns:

DirectoryItem

A DirectoryItem representing the root directory and its subdirectories.

Overrides: FileBrowserContentProvider.ResolveRootDirectoryAsTree(string)

Stores a bitmap image at the specified URL using the given image format.

C#
public override string StoreBitmap(Bitmap bitmap, string url, ImageFormat format)
Parameters:bitmapBitmap

The Bitmap to store.

urlstring

The URL where the bitmap will be stored.

formatImageFormat

The image format to use.

Returns:

string

The URL where the bitmap was stored.

Overrides: FileBrowserContentProvider.StoreBitmap(Bitmap, string, ImageFormat)

Stores a file from an HttpPostedFile at the specified path and name.

C#
[Obsolete("Please use the other overload of StoreFile()")]
public override string StoreFile(HttpPostedFile file, string path, string name, params string[] arguments)
Parameters:fileHttpPostedFile

The HttpPostedFile to store.

pathstring

The virtual path where the file will be stored.

namestring

The name of the file.

argumentsstring[]

Additional arguments for storing the file.

Returns:

string

The virtual path of the stored file.

Overrides: FileBrowserContentProvider.StoreFile(HttpPostedFile, string, string, params string[])

Stores an uploaded file at the specified path and name.

C#
public override string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
Parameters:fileUploadedFile

The UploadedFile to store.

pathstring

The virtual path where the file will be stored.

namestring

The name of the file.

argumentsstring[]

Additional arguments for storing the file.

Returns:

string

The virtual path of the stored file.

Overrides: FileBrowserContentProvider.StoreFile(UploadedFile, string, string, params string[])