Search Results for

    Show / Hide Table of Contents

    Class FileConnectorBase

    Base file connector class

    Inheritance
    System.Object
    FileConnectorBase
    FileSystemConnector
    OpenXMLConnector
    SharePointConnector
    Namespace: PnP.Framework.Provisioning.Connectors
    Assembly: PnP.Framework.dll
    Syntax
    public abstract class FileConnectorBase : object

    Fields

    CONNECTIONSTRING

    Declaration
    public const string CONNECTIONSTRING = null
    Field Value
    System.String

    CONTAINER

    Declaration
    public const string CONTAINER = null
    Field Value
    System.String

    Properties

    Parameters

    Parameters required for the file.

    Declaration
    public Dictionary<string, object> Parameters { get; }
    Property Value
    Dictionary<System.String, System.Object>

    Methods

    AddParameter(String, Object)

    Adds Parameter as an object.

    Declaration
    public void AddParameter(string key, object value)
    Parameters
    System.String key

    Key for adding parameter

    System.Object value

    Value of the parameter

    AddParameterAsString(String, String)

    Adds Parameter as a string.

    Declaration
    public void AddParameterAsString(string key, string value)
    Parameters
    System.String key

    Key for adding parameter

    System.String value

    Value of the parameter

    DeleteFile(String)

    Deletes a file from the default container

    Declaration
    public abstract void DeleteFile(string fileName)
    Parameters
    System.String fileName

    Name of the file to delete

    DeleteFile(String, String)

    Deletes a file from the specified container

    Declaration
    public abstract 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

    GetFile(String)

    Gets a file as string from the default container

    Declaration
    public abstract string GetFile(string fileName)
    Parameters
    System.String fileName

    Name of the file to get

    Returns
    System.String

    String containing the file contents

    GetFile(String, String)

    Gets a file as string from the specified container

    Declaration
    public abstract 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

    GetFilenamePart(String)

    Returns a filename without a path

    Declaration
    public abstract string GetFilenamePart(string fileName)
    Parameters
    System.String fileName

    Path to the file to retrieve the filename from

    Returns
    System.String

    GetFiles()

    Get the files available in the default container

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

    List of files

    GetFiles(String)

    Get the files available in the specified container

    Declaration
    public abstract 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

    GetFileStream(String)

    Gets a file as stream from the default container

    Declaration
    public abstract Stream GetFileStream(string fileName)
    Parameters
    System.String fileName

    Name of the file to get

    Returns
    Stream

    String containing the file contents

    GetFileStream(String, String)

    Gets a file as stream from the specified container

    Declaration
    public abstract 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

    GetFolders()

    Get the folders of the default container

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

    List of folders

    GetFolders(String)

    Get the folders of a specified container

    Declaration
    public abstract 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

    SaveFileStream(String, Stream)

    Saves a stream to the default container with the given name. If the file exists it will be overwritten

    Declaration
    public abstract void SaveFileStream(string fileName, Stream stream)
    Parameters
    System.String fileName

    Name of the file to save

    Stream stream

    Stream containing the file contents

    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 abstract 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

    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