Class DefaultBlobFactory
Inheritance
Namespace: EPiServer.Framework.Blobs.Internal
Assembly: EPiServer.Framework.dll
Version: 12.0.3Syntax
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 |
---|---|---|
Blob |
options | |
System. |
providers |
Properties
DefaultProvider
The default provider
Declaration
public string DefaultProvider { get; set; }
Property Value
Type | Description |
---|---|
System. |
Methods
AddProvider(BlobProvider)
Register a blob provider
Declaration
public virtual void AddProvider(BlobProvider provider)
Parameters
Type | Name | Description |
---|---|---|
Blob |
provider | The provider to register |
Exceptions
Type | Condition |
---|---|
System. |
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 |
---|---|---|
Blob |
options | |
System. |
serviceProvider |
Returns
Type | Description |
---|---|
Default |
CreateBlob(Uri, String)
Get a reference to a blob
Declaration
public virtual Blob CreateBlob(Uri id, string extension)
Parameters
Type | Name | Description |
---|---|---|
System. |
id | The identifier of the container |
System. |
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. |
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. |
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. |
id | The blob identifier |
Returns
Type | Description |
---|---|
Blob |
A blob provider |
Exceptions
Type | Condition |
---|---|
System. |
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. |
name | The name of the provider (also used as authority in blob ID) |
Returns
Type | Description |
---|---|
System. |
Returns |
Remarks
Provider names are not case sensitive