C# Класс OfficeDevPnP.Core.Framework.Provisioning.Connectors.SharePointConnector

Connector for files in SharePoint
Наследование: OfficeDevPnP.Core.Framework.Provisioning.Connectors.FileConnectorBase
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
DeleteFile ( string fileName ) : void

Deletes a file from the default container

DeleteFile ( string fileName, string container ) : void

Deletes a file from the specified container

GetFile ( string fileName ) : string

Gets a file as string from the default container

GetFile ( string fileName, string container ) : string

Gets a file as string from the specified container

GetFileStream ( string fileName ) : Stream

Gets a file as stream from the default container

GetFileStream ( string fileName, string container ) : Stream

Gets a file as stream from the specified container

GetFilenamePart ( string fileName ) : string
GetFiles ( ) : List

Get the files available in the default container

GetFiles ( string container ) : List

Get the files available in the specified container

GetFolders ( ) : List

Get the folders of the default container

GetFolders ( string container ) : List

Get the folders of a specified container

SaveFileStream ( string fileName, Stream stream ) : void

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

SaveFileStream ( string fileName, string container, Stream stream ) : void

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

SharePointConnector ( ) : System

Base constructor

SharePointConnector ( ClientRuntimeContext clientContext, string connectionString, string container ) : System

SharePointConnector constructor. Allows to directly set root folder and sub folder

Приватные методы

Метод Описание
GetClientContext ( ) : ClientRuntimeContext
GetContainer ( ) : string
GetDocumentLibrary ( string container ) : string
GetFileFromStorage ( string fileName, string container ) : MemoryStream
GetFileServerRelativeUrl ( ClientContext cc, string fileName, string container ) : string
GetUrlFolders ( string container ) : string

Описание методов

DeleteFile() публичный Метод

Deletes a file from the default container
public DeleteFile ( string fileName ) : void
fileName string Name of the file to delete
Результат void

DeleteFile() публичный Метод

Deletes a file from the specified container
public DeleteFile ( string fileName, string container ) : void
fileName string Name of the file to delete
container string Name of the container to delete the file from
Результат void

GetFile() публичный Метод

Gets a file as string from the default container
public GetFile ( string fileName ) : string
fileName string Name of the file to get
Результат string

GetFile() публичный Метод

Gets a file as string from the specified container
public GetFile ( string fileName, string container ) : string
fileName string Name of the file to get
container string Name of the container to get the file from
Результат string

GetFileStream() публичный Метод

Gets a file as stream from the default container
public GetFileStream ( string fileName ) : Stream
fileName string Name of the file to get
Результат Stream

GetFileStream() публичный Метод

Gets a file as stream from the specified container
public GetFileStream ( string fileName, string container ) : Stream
fileName string Name of the file to get
container string Name of the container to get the file from
Результат Stream

GetFilenamePart() публичный Метод

public GetFilenamePart ( string fileName ) : string
fileName string
Результат string

GetFiles() публичный Метод

Get the files available in the default container
public GetFiles ( ) : List
Результат List

GetFiles() публичный Метод

Get the files available in the specified container
public GetFiles ( string container ) : List
container string Name of the container to get the files from
Результат List

GetFolders() публичный Метод

Get the folders of the default container
public GetFolders ( ) : List
Результат List

GetFolders() публичный Метод

Get the folders of a specified container
public GetFolders ( string container ) : List
container string Name of the container to get the folders from
Результат List

SaveFileStream() публичный Метод

Saves a stream to the default container with the given name. If the file exists it will be overwritten
public SaveFileStream ( string fileName, Stream stream ) : void
fileName string Name of the file to save
stream Stream Stream containing the file contents
Результат void

SaveFileStream() публичный Метод

Saves a stream to the specified container with the given name. If the file exists it will be overwritten
public SaveFileStream ( string fileName, string container, Stream stream ) : void
fileName string Name of the file to save
container string Name of the container to save the file to
stream Stream Stream containing the file contents
Результат void

SharePointConnector() публичный Метод

Base constructor
public SharePointConnector ( ) : System
Результат System

SharePointConnector() публичный Метод

SharePointConnector constructor. Allows to directly set root folder and sub folder
public SharePointConnector ( ClientRuntimeContext clientContext, string connectionString, string container ) : System
clientContext ClientRuntimeContext
connectionString string Site collection URL (e.g. https://yourtenant.sharepoint.com/sites/dev)
container string Library + folder that holds the files (mydocs/myfolder)
Результат System