Nucleus .Net Core CMS

FileSystemProviders.FileSystemProvider Class

Namespace: Nucleus.Abstractions.FileSystemProviders
Assembly: Nucleus.Abstractions.dll
Abstract class implemented by all file system providers.
File system provider key (from configuration)
Configure (IConfigurationSection configSection, String HomeDirectory)
Sets the configuration for this instance.
Parameters
Name Type
configSection Microsoft.Extensions.Configuration.IConfigurationSection
HomeDirectory String
CreateFolder (String parentPath, String newFolder)
Create a new folder.
Parameters
Name Type
parentPath String
newFolder String
DeleteFile (String path)
Delete an existing file.
Parameters
Name Type
path String
DeleteFolder (String path, Boolean recursive)
Delete an existing folder.
Parameters
Name Type
path String
recursive Boolean
GetFile (String path)
Get an existing file.
Parameters
Name Type
path String
GetFileContents (String path)
Retrieve the contents of an existing file and return as a stream.
Parameters
Name Type
path String
GetFileDirectUrl (String path, DateTime expiresOn)
Get an direct access Url for the file.
Parameters
Name Type
path String
expiresOn DateTime
Remarks
This method can return null to indicate that the file system provider cannot provide a direct Url to the file.
GetFolder (String path)
Get an existing folder.
Parameters
Name Type
path String
ListFolder (String path)
List the contents of a folder.
Parameters
Name Type
path String
ListFolder (String path, String pattern)
List the contents of a folder, filtered by the regular expression specified in pattern.
Parameters
Name Type
path String
pattern String
RenameFile (String path, String newName)
Rename an existing file.
Parameters
Name Type
path String
newName String
RenameFolder (String path, String newName)
Rename an existing folder.
Parameters
Name Type
path String
newName String
SaveFile (String parentPath, String newFileName, Stream content, Boolean overwrite)
Save a file.
Parameters
Name Type
parentPath String
newFileName String
content System.IO.Stream
overwrite Boolean