SaaS CMS has officially launched! Learn more now.

Class DefaultBlobFactory

Inheritance
System.Object
DefaultBlobFactory
Namespace: EPiServer.Framework.Blobs.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3
Syntax
public class DefaultBlobFactory : Object, IBlobFactory, IBlobProviderRegistry

Constructors

DefaultBlobFactory()

Declaration
public DefaultBlobFactory()

DefaultBlobFactory(BlobProvidersOptions, IEnumerable<BlobProvider>)

Declaration
public DefaultBlobFactory(BlobProvidersOptions options, IEnumerable<BlobProvider> providers)
Parameters
Type Name Description
BlobProvidersOptions options
System.Collections.Generic.IEnumerable<BlobProvider> providers

Properties

DefaultProvider

The default provider

Declaration
public string DefaultProvider { get; set; }
Property Value
Type Description
System.String

Methods

AddProvider(BlobProvider)

Register a blob provider

Declaration
public virtual void AddProvider(BlobProvider provider)
Parameters
Type Name Description
BlobProvider provider

The provider to register

Exceptions
Type Condition
System.ArgumentNullException

Thrown when provider or its name is null or empty

Create(BlobProvidersOptions, IServiceProvider)

Declaration
public static DefaultBlobFactory Create(BlobProvidersOptions options, IServiceProvider serviceProvider)
Parameters
Type Name Description
BlobProvidersOptions options
System.IServiceProvider serviceProvider
Returns
Type Description
DefaultBlobFactory

CreateBlob(Uri, String)

Get a reference to a blob

Declaration
public virtual Blob CreateBlob(Uri id, string extension)
Parameters
Type Name Description
System.Uri id

The identifier of the container

System.String extension

The extension (such as ".png")

Returns
Type Description
Blob

A reference to a blob

Remarks

This method will always return a reference even though the actual blob does not exists

Delete(Uri)

Delete a blob or a container

Declaration
public virtual void Delete(Uri id)
Parameters
Type Name Description
System.Uri id

The identifier of a blob or a blob container

Remarks

The Host part of the identifier is the container and the path is the file/blob that is being deleted. If the file is missing it is assumed that the container is being deleted.

GetBlob(Uri)

Get a reference to a blob

Declaration
public virtual Blob GetBlob(Uri id)
Parameters
Type Name Description
System.Uri id

The identifier

Returns
Type Description
Blob

A reference to a blob

Remarks

This method will always return a reference even though the actual blob does not exists

GetProvider(Uri)

Get the provider for a blob authority

Declaration
public virtual BlobProvider GetProvider(Uri id)
Parameters
Type Name Description
System.Uri id

The blob identifier

Returns
Type Description
BlobProvider

A blob provider

Exceptions
Type Condition
System.ArgumentException

Thrown if no matching provider was found

RemoveProvider(String)

Unregister a blob provider

Declaration
public virtual bool RemoveProvider(string name)
Parameters
Type Name Description
System.String name

The name of the provider (also used as authority in blob ID)

Returns
Type Description
System.Boolean

Returns true if the provider was found and removed

Remarks

Provider names are not case sensitive

Implements

Extension Methods