Class SharePointConnector
Connector for files in SharePoint
Inherited Members
Namespace: PnP.Framework.Provisioning.Connectors
Assembly: PnP.Framework.dll
Syntax
public class SharePointConnector : FileConnectorBase
Connector for files in SharePoint
public class SharePointConnector : FileConnectorBase
Base constructor
public SharePointConnector()
SharePointConnector constructor. Allows to directly set root folder and sub folder
public SharePointConnector(ClientRuntimeContext clientContext, string connectionString, string container)
ClientRuntimeContext
clientContext
Client context for SharePoint connection |
System.String
connectionString
Site collection URL (e.g. https://yourtenant.sharepoint.com/sites/dev) |
System.String
container
Library + folder that holds the files (mydocs/myfolder) |
public const string CLIENTCONTEXT = null
System.String
|
Deletes a file from the default container
public override void DeleteFile(string fileName)
System.String
fileName
Name of the file to delete |
Deletes a file from the specified container
public override void DeleteFile(string fileName, string container)
System.String
fileName
Name of the file to delete |
System.String
container
Name of the container to delete the file from |
Gets a file as string from the default container
public override string GetFile(string fileName)
System.String
fileName
Name of the file to get |
System.String
String containing the file contents |
Gets a file as string from the specified container
public override string GetFile(string fileName, string container)
System.String
fileName
Name of the file to get |
System.String
container
Name of the container to get the file from |
System.String
String containing the file contents |
Returns a filename without a path
public override string GetFilenamePart(string fileName)
System.String
fileName
Name of the file |
System.String
Returns a filename without a path |
Get the files available in the default container
public override List<string> GetFiles()
List<System.String>
List of files |
Get the files available in the specified container
public override List<string> GetFiles(string container)
System.String
container
Name of the container to get the files from |
List<System.String>
List of files |
Gets a file as stream from the default container
public override Stream GetFileStream(string fileName)
System.String
fileName
Name of the file to get |
Stream
String containing the file contents |
Gets a file as stream from the specified container
public override Stream GetFileStream(string fileName, string container)
System.String
fileName
Name of the file to get |
System.String
container
Name of the container to get the file from |
Stream
String containing the file contents |
Get the folders of the default container
public override List<string> GetFolders()
List<System.String>
List of folders |
Get the folders of a specified container
public override List<string> GetFolders(string container)
System.String
container
Name of the container to get the folders from |
List<System.String>
List of folders |
Saves a stream to the default container with the given name. If the file exists it will be overwritten
public override void SaveFileStream(string fileName, Stream stream)
System.String
fileName
Name of the file to save |
Stream
stream
Stream containing the file contents |
Saves a stream to the specified container with the given name. If the file exists it will be overwritten
public override void SaveFileStream(string fileName, string container, Stream stream)
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 |