Class FileSystemConnector
Connector for files in file system
Inherited Members
Namespace: PnP.Framework.Provisioning.Connectors
Assembly: PnP.Framework.dll
Syntax
public class FileSystemConnector : FileConnectorBase
Constructors
FileSystemConnector()
Base constructor
Declaration
public FileSystemConnector()
FileSystemConnector(String, String)
FileSystemConnector constructor. Allows to directly set root folder and sub folder
Declaration
public FileSystemConnector(string connectionString, string container)
Parameters
|
System.String
connectionString
Root folder (e.g. c:\temp or .\resources or . or .\resources\templates) |
|
System.String
container
Sub folder (e.g. templates or resources\templates or blank |
Methods
DeleteFile(String)
Deletes a file from the default container
Declaration
public override void DeleteFile(string fileName)
Parameters
|
System.String
fileName
Name of the file to delete |
Overrides
DeleteFile(String, String)
Deletes a file from the specified container
Declaration
public override void DeleteFile(string fileName, string container)
Parameters
|
System.String
fileName
Name of the file to delete |
|
System.String
container
Name of the container to delete the file from |
Overrides
GetFile(String)
Gets a file as string from the default container
Declaration
public override string GetFile(string fileName)
Parameters
|
System.String
fileName
Name of the file to get |
Returns
|
System.String
String containing the file contents |
Overrides
GetFile(String, String)
Gets a file as string from the specified container
Declaration
public override string GetFile(string fileName, string container)
Parameters
|
System.String
fileName
Name of the file to get |
|
System.String
container
Name of the container to get the file from |
Returns
|
System.String
String containing the file contents |
Overrides
GetFilenamePart(String)
Returns a filename without a path
Declaration
public override string GetFilenamePart(string fileName)
Parameters
|
System.String
fileName
Name of the file |
Returns
|
System.String
Returns filename without path |
Overrides
GetFiles()
Get the files available in the default container
Declaration
public override List<string> GetFiles()
Returns
|
List<System.String>
List of files |
Overrides
GetFiles(String)
Get the files available in the specified container
Declaration
public override List<string> GetFiles(string container)
Parameters
|
System.String
container
Name of the container to get the files from |
Returns
|
List<System.String>
List of files |
Overrides
GetFileStream(String)
Gets a file as stream from the default container
Declaration
public override Stream GetFileStream(string fileName)
Parameters
|
System.String
fileName
Name of the file to get |
Returns
|
Stream
String containing the file contents |
Overrides
GetFileStream(String, String)
Gets a file as stream from the specified container
Declaration
public override Stream GetFileStream(string fileName, string container)
Parameters
|
System.String
fileName
Name of the file to get |
|
System.String
container
Name of the container to get the file from |
Returns
|
Stream
String containing the file contents |
Overrides
GetFolders()
Get the folders of the default container
Declaration
public override List<string> GetFolders()
Returns
|
List<System.String>
List of folders |
Overrides
GetFolders(String)
Get the folders of a specified container
Declaration
public override List<string> GetFolders(string container)
Parameters
|
System.String
container
Name of the container to get the folders from |
Returns
|
List<System.String>
List of folders |
Overrides
SaveFileStream(String, Stream)
Saves a stream to the default container with the given name. If the file exists it will be overwritten
Declaration
public override void SaveFileStream(string fileName, Stream stream)
Parameters
|
System.String
fileName
Name of the file to save |
|
Stream
stream
Stream containing the file contents |
Overrides
SaveFileStream(String, String, Stream)
Saves a stream to the specified container with the given name. If the file exists it will be overwritten
Declaration
public override void SaveFileStream(string fileName, string container, Stream stream)
Parameters
|
System.String
fileName
Name of the file to save |
|
System.String
container
Name of the container to save the file to |
|
Stream
stream
Stream containing the file contents |