SaaS CMS has officially launched! Learn more now.

Class FileTransfer

Base functionality to transfer files using the vitual path providers. The transfer functionality is based on the providers name, eg a provider with the same name has to exist on the importing site.

Inheritance
System.Object
FileTransfer
Implements
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Core.Transfer
Assembly: EPiServer.dll
Version: 8.11.0
Syntax
[ServiceConfiguration(typeof(IFileTransfer))]
public class FileTransfer : IFileTransfer

Constructors

FileTransfer(IContentRepository, IContentLoader, IContentProviderManager, IPageQuickSearch)

Initializes a new instance of the FileTransfer class.

Declaration
public FileTransfer(IContentRepository contentRepository, IContentLoader contentQueryable, IContentProviderManager pageProviderManager, IPageQuickSearch pageQuickSearcher)
Parameters
Type Name Description
IContentRepository contentRepository

The page repository.

IContentLoader contentQueryable

The content queryable.

IContentProviderManager pageProviderManager

The page enterprise service.

IPageQuickSearch pageQuickSearcher

The page quick searcher.

Properties

Files

Returns a list of all files in the context.

Declaration
public IList<IFileTransferObject> Files { get; }
Property Value
Type Description
System.Collections.Generic.IList<IFileTransferObject>

The files to be transferred.

TransferContext

Gets or sets the transfer context.

Declaration
public IContentTransferContext TransferContext { get; set; }
Property Value
Type Description
IContentTransferContext

The transfer context.

Methods

AddFile(String)

Add the file to export, after checking for validity and existance. If already added, nothing happens.

Declaration
public string AddFile(string url)
Parameters
Type Name Description
System.String url

An URL to the file, presumably a UnifiedFile path

Returns
Type Description
System.String

A possibly modified string with place holders, or the url unmodified if it could not be added due to invalidity etc.

CreatePathForFile(VirtualPathUnifiedProvider, String)

Creates the physical path for file.

Declaration
public static UnifiedDirectory CreatePathForFile(VirtualPathUnifiedProvider provider, string providerRelativePath)
Parameters
Type Name Description
VirtualPathUnifiedProvider provider

The provider to create path for.

System.String providerRelativePath

The provider relative path.

Returns
Type Description
UnifiedDirectory

The created directory.

Export()

Returns and clear the files for this exporter.

Declaration
public IFileTransferObject[] Export()
Returns
Type Description
IFileTransferObject[]

A list of files to export.

Import(IFileTransferObject)

Transform the meta data from a imported package..

Declaration
public IFileTransferObject Import(IFileTransferObject metaData)
Parameters
Type Name Description
IFileTransferObject metaData

The file transfer object to import.

Returns
Type Description
IFileTransferObject

A transformed file transfer object.

TryAddBlob(Blob)

Adds a Blob instance to the package.

Declaration
public bool TryAddBlob(Blob blob)
Parameters
Type Name Description
Blob blob

The BLOB.

Returns
Type Description
System.Boolean

true if the blob was added else false.

Remarks

FileTransfer does not support Blob and will always return false.

TryAddFile(String, out String)

Add the file to export, after checking for validity and existance. If already added, nothing happens.

Declaration
public bool TryAddFile(string filePath, out string addedFilePath)
Parameters
Type Name Description
System.String filePath

The file path.

System.String addedFilePath

The added file path.

Returns
Type Description
System.Boolean

true if the file was added to package else false

Implements

Extension Methods