Class AssetTransfer
Class for operations for transferring the assets over to the target site collection
Inherited Members
Namespace: PnP.Framework.Modernization.Transform
Assembly: PnP.Framework.dll
Syntax
public class AssetTransfer : BaseTransform
Constructors
AssetTransfer(ClientContext, ClientContext, IList<ILogObserver>)
Constructor for the asset transfer class
Declaration
public AssetTransfer(ClientContext source, ClientContext target, IList<ILogObserver> logObservers = null)
Parameters
Client Source connection to SharePoint |
Client Target connection to SharePoint |
IList<ILog
|
Methods
ConvertFileToFolderFriendlyName(String)
Converts the file name into a friendly format
Declaration
public string ConvertFileToFolderFriendlyName(string fileName)
Parameters
System.
|
Returns
System.
|
CopyAssetToTargetLocation(String, String, Int32)
Copy the file from the source to the target location
Declaration
public string CopyAssetToTargetLocation(string sourceFileUrl, string targetLocationUrl, int fileChunkSizeInMB = 3)
Parameters
System.
|
System.
|
System. Size of chunks in MB in which the file will be split to be copied |
Returns
System.
|
Remarks
Based on the documentation: https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/upload-large-files-sample-app-for-sharepoint
EnsureDestination(String)
Ensure the site assets and page sub-folder exists in the target location
Declaration
public string EnsureDestination(string pageFileName)
Parameters
System.
|
Returns
System.
|
EnsureSiteAssetsLibrary()
Create a site assets library
Declaration
public List EnsureSiteAssetsLibrary()
Returns
List
|
GetAssetTransferredIfExists(AssetTransferredEntity)
Get asset transfer details if they already exist
Declaration
public AssetTransferredEntity GetAssetTransferredIfExists(AssetTransferredEntity assetTransferredEntity)
Parameters
Asset
|
Returns
StoreAssetTransferred(AssetTransferredEntity)
Stores an asset transfer reference
Declaration
public void StoreAssetTransferred(AssetTransferredEntity assetTransferredEntity)
Parameters
Asset
|
TransferAsset(String, String)
Main entry point to perform the series of operations to transfer related assets
Declaration
public string TransferAsset(string sourceAssetRelativeUrl, string pageFileName)
Parameters
System.
|
System.
|
Returns
System.
|
Validate()
Perform validation
Declaration
public void Validate()
ValidateAssetInSupportedLocation(String)
Checks if the URL is located in a supported location
Declaration
public bool ValidateAssetInSupportedLocation(string sourceUrl)
Parameters
System.
|
Returns
System.
|