Search Results for

    Show / Hide Table of Contents

    Class FileSystemConnector

    Connector for files in file system

    Inheritance
    System.Object
    FileConnectorBase
    FileSystemConnector
    Inherited Members
    FileConnectorBase.CONNECTIONSTRING
    FileConnectorBase.CONTAINER
    FileConnectorBase.Parameters
    FileConnectorBase.AddParameterAsString(String, String)
    FileConnectorBase.AddParameter(String, Object)
    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
    FileConnectorBase.DeleteFile(String)

    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
    FileConnectorBase.DeleteFile(String, String)

    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
    FileConnectorBase.GetFile(String)

    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
    FileConnectorBase.GetFile(String, String)

    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
    FileConnectorBase.GetFilenamePart(String)

    GetFiles()

    Get the files available in the default container

    Declaration
    public override List<string> GetFiles()
    Returns
    List<System.String>

    List of files

    Overrides
    FileConnectorBase.GetFiles()

    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
    FileConnectorBase.GetFiles(String)

    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
    FileConnectorBase.GetFileStream(String)

    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
    FileConnectorBase.GetFileStream(String, String)

    GetFolders()

    Get the folders of the default container

    Declaration
    public override List<string> GetFolders()
    Returns
    List<System.String>

    List of folders

    Overrides
    FileConnectorBase.GetFolders()

    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
    FileConnectorBase.GetFolders(String)

    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
    FileConnectorBase.SaveFileStream(String, Stream)

    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

    Overrides
    FileConnectorBase.SaveFileStream(String, String, Stream)

    Extension Methods

    ValidationExtensions.ValidateNotNullOrEmpty<T>(T, String)
    ObjectExtensions.Set<TObject, T>(TObject, Expression<Func<TObject, T>>, T, Boolean, Boolean)
    ObjectExtensions.GetPublicInstancePropertyValue(Object, String)
    ObjectExtensions.GetPublicInstanceProperty(Object, String)
    ObjectExtensions.SetPublicInstancePropertyValue(Object, String, Object)
    Extensions.ToByteArray(Object)
    Back to top PnP Framework
    Generated by DocFX with Material UI
    spacer