C# 클래스 OfficeDevPnP.Core.Framework.Provisioning.Connectors.SharePointConnector

Connector for files in SharePoint
상속: OfficeDevPnP.Core.Framework.Provisioning.Connectors.FileConnectorBase
파일 보기 프로젝트 열기: OfficeDev/PnP-Sites-Core 1 사용 예제들

공개 메소드들

메소드 설명
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