C# Class ImageProcessor.Web.Plugins.AmazonS3Cache.AmazonS3Cache

Provides an IImageCache implementation that uses Amazon S3 storage. The cache is self healing and cleaning.
Inheritance: ImageProcessor.Web.Caching.ImageCacheBase
Afficher le fichier Open project: JimBobSquarePants/ImageProcessor

Private Properties

Свойство Type Description
GetKey string
GetRegionEndpoint Amazon.RegionEndpoint
TryFiveTimes void

Méthodes publiques

Méthode Description
AddImageToCacheAsync ( Stream stream, string contentType ) : System.Threading.Tasks.Task

Adds the image to the cache in an asynchronous manner.

AmazonS3Cache ( string requestPath, string fullPath, string querystring ) : System

Initializes a new instance of the AmazonS3Cache class.

CreateCachedFileNameAsync ( ) : Task

Gets a string identifying the cached file name.

IsNewOrUpdatedAsync ( ) : Task

Gets a value indicating whether the image is new or updated in an asynchronous manner.

RewritePath ( HttpContext context ) : void

Rewrites the path to point to the cached image.

TrimCacheAsync ( ) : System.Threading.Tasks.Task

Trims the cache of any expired items in an asynchronous manner.

Méthodes protégées

Méthode Description
GetFolderStructureForAmazon ( string path ) : string

Helper to get folder structure from amazon

Private Methods

Méthode Description
GetKey ( string path, string fileName ) : string

Helper to construct object key from path

GetRegionEndpoint ( ) : RegionEndpoint

Helper to get AWS Region Endpoint from configuration file

TryFiveTimes ( System.Action delegateAction, System.Action exceptionAction ) : void

Tries to execute a delegate action five times.

Method Details

AddImageToCacheAsync() public méthode

Adds the image to the cache in an asynchronous manner.
public AddImageToCacheAsync ( Stream stream, string contentType ) : System.Threading.Tasks.Task
stream Stream /// The stream containing the image data. ///
contentType string /// The content type of the image. ///
Résultat System.Threading.Tasks.Task

AmazonS3Cache() public méthode

Initializes a new instance of the AmazonS3Cache class.
public AmazonS3Cache ( string requestPath, string fullPath, string querystring ) : System
requestPath string /// The request path for the image. ///
fullPath string /// The full path for the image. ///
querystring string /// The querystring containing instructions. ///
Résultat System

CreateCachedFileNameAsync() public méthode

Gets a string identifying the cached file name.
public CreateCachedFileNameAsync ( ) : Task
Résultat Task

GetFolderStructureForAmazon() protected méthode

Helper to get folder structure from amazon
protected GetFolderStructureForAmazon ( string path ) : string
path string Web path to file's folder
Résultat string

IsNewOrUpdatedAsync() public méthode

Gets a value indicating whether the image is new or updated in an asynchronous manner.
public IsNewOrUpdatedAsync ( ) : Task
Résultat Task

RewritePath() public méthode

Rewrites the path to point to the cached image.
public RewritePath ( HttpContext context ) : void
context System.Web.HttpContext /// The encapsulating all information about the request. ///
Résultat void

TrimCacheAsync() public méthode

Trims the cache of any expired items in an asynchronous manner.
public TrimCacheAsync ( ) : System.Threading.Tasks.Task
Résultat System.Threading.Tasks.Task