Class OpenXMLConnector
Connector that stores all the files into a unique .PNP OpenXML package
Inherited Members
Namespace: PnP.Framework.Provisioning.Connectors
Assembly: PnP.Framework.dll
Syntax
public class OpenXMLConnector : FileConnectorBase, ICommitableFileConnector
Constructors
OpenXMLConnector(Stream)
OpenXMLConnector constructor. Allows to manage a .PNP OpenXML package through an in memory stream.
Declaration
public OpenXMLConnector(Stream packageStream)
Parameters
Stream
packageStream
The package stream |
OpenXMLConnector(String, FileConnectorBase, String, X509Certificate2, String)
OpenXMLConnector constructor. Allows to manage a .PNP OpenXML package file through a supporting persistence connector.
Declaration
public OpenXMLConnector(string packageFileName, FileConnectorBase persistenceConnector, string author = null, X509Certificate2 signingCertificate = null, string templateFileName = null)
Parameters
System. The name of the .PNP package file. If the .PNP extension is missing, it will be added |
File The FileConnector object that will be used for physical persistence of the file |
System. The Author of the .PNP package file, if any. Optional |
X509Certificate2
signingCertificate
The X.509 certificate to use for digital signature of the template, optional |
System. The name of the tempalte file, optional |
Properties
Info
Methods
Commit()
DeleteFile(String)
Deletes a file from the default container
Declaration
public override void DeleteFile(string fileName)
Parameters
System. Name of the file to delete |
Overrides
DeleteFile(String, String)
Deletes a file from the specified container
Declaration
public override void DeleteFile(string fileName, string container)
Parameters
System. Name of the file to delete |
System. Name of the container to delete the file from |
Overrides
GetFile(String)
Gets a file as string from the default container
Declaration
public override string GetFile(string fileName)
Parameters
System. Name of the file to get |
Returns
System. String containing the file contents |
Overrides
GetFile(String, String)
Gets a file as string from the specified container
Declaration
public override string GetFile(string fileName, string container)
Parameters
System. Name of the file to get |
System. Name of the container to get the file from |
Returns
System. String containing the file contents |
Overrides
GetFilenamePart(String)
Returns a filename without a path
Declaration
public override string GetFilenamePart(string fileName)
Parameters
System. Name of the file to get |
Returns
System. Returns a filename without a path |
Overrides
GetFiles()
Get the files available in the default container
Declaration
public override List<String> GetFiles()
Returns
List<String>
List of files |
Overrides
GetFiles(String)
Get the files available in the specified container
Declaration
public override List<string> GetFiles(string container)
Parameters
System. Name of the container to get the files from (something like: "\images\subfolder") |
Returns
List<System. List of files |
Overrides
GetFileStream(String)
Gets a file as stream from the default container
Declaration
public override Stream GetFileStream(string fileName)
Parameters
System. Name of the file to get |
Returns
Stream
String containing the file contents |
Overrides
GetFileStream(String, String)
Gets a file as stream from the specified container
Declaration
public override Stream GetFileStream(string fileName, string container)
Parameters
System. Name of the file to get |
System. Name of the container to get the file from |
Returns
Stream
String containing the file contents |
Overrides
GetFolders()
Get the folders of the default container
Declaration
public override List<string> GetFolders()
Returns
List<System. List of folders |
Overrides
GetFolders(String)
Get the folders of a specified container
Declaration
public override List<string> GetFolders(string container)
Parameters
System. Name of the container to get the folders from |
Returns
List<System. List of folders |
Overrides
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. Name of the file to save |
Stream
stream
Stream containing the file contents |
Overrides
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. Name of the file to save |
System. Name of the container to save the file to |
Stream
stream
Stream containing the file contents |