Allows clients to request objects located on another amazon S3 server through this server. Allows URL rewriting.
More...
|
delegate void | RewriteBucketAndKeyPath (S3VirtualPathProvider sender, S3PathEventArgs e) |
|
string | FilterPath (string path) |
| Execites the PreS3RequestFilter event and returns the result. More...
|
|
| S3VirtualPathProvider (AmazonS3Client s3client, String virtualFilesystemPrefix, TimeSpan absoluteMetadataExpiration, TimeSpan slidingMetadataExpiration, RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode) |
| Create and configure a virtual path provider. More...
|
|
| S3VirtualPathProvider (RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode) |
| Default settings: CommunicationProtocol=HTTP, VirtualFileSystemPrefix = "~/s3", SlidingExpiration = 1h, AbsoluteExpiration = maxvalue No bucket filtering is performed, so any amazon-hosted bucket can be accessed through this provider unless you add a bucket filter. More...
|
|
bool | IsPathVirtual (string virtualPath) |
| Determines whether a specified virtual path is within the virtual file system. More...
|
|
override bool | FileExists (string virtualPath) |
|
override VirtualFile | GetFile (string virtualPath) |
|
override CacheDependency | GetCacheDependency (string virtualPath, System.Collections.IEnumerable virtualPathDependencies, DateTime utcStart) |
|
bool | FileExists (string virtualPath, System.Collections.Specialized.NameValueCollection queryString) |
|
IVirtualFile | GetFile (string virtualPath, System.Collections.Specialized.NameValueCollection queryString) |
|
bool | FileExists (string virtualPath, NameValueCollection queryString) |
| Returns true if the specified file exists. More...
|
|
IVirtualFile | GetFile (string virtualPath, NameValueCollection queryString) |
| Returns a virtual file instance for the specified path and querystring. More...
|
|
|
override void | Initialize () |
|
|
string | VirtualFilesystemPrefix [get, set] |
| Requests starting with this path will be handled by this virtual path provider. Should be in app-relative form: "~/s3/". Will be converted to root-relative form upon assigment. Trailing slash required, auto-added. More...
|
|
TimeSpan | MetadataAbsoluteExpiration [get, set] |
| Existence and modified date metadata about files is cached for, at longest, this amount of time after it is first stored. More...
|
|
TimeSpan | MetadataSlidingExpiration [get, set] |
| Existence and modified date metadata about files is cached for this long after it is last accessed. More...
|
|
AmazonS3Client | S3Client [get, set] |
| Gets and sets the AmazonS3Client object that specifies connection details such as authentication, encryption, etc. More...
|
|
bool | FastMode [get, set] |
| If true, existence of bucket and key is assumed as long as prefix is present. Defaults to true. Also, no modified date information is provided, so the cache never gets updated. Requires 1 request instead of 2 to download the image. More...
|
|
|
RewriteBucketAndKeyPath | PreS3RequestFilter |
| Important! You should handle this event and throw an exception if a bucket that you do not own is requested. Otherwise other people's buckets could be accessed using your server. More...
|
|
Allows clients to request objects located on another amazon S3 server through this server. Allows URL rewriting.
Definition at line 18 of file S3VirtualPathProvider.cs.
ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.S3VirtualPathProvider |
( |
AmazonS3Client |
s3client, |
|
|
String |
virtualFilesystemPrefix, |
|
|
TimeSpan |
absoluteMetadataExpiration, |
|
|
TimeSpan |
slidingMetadataExpiration, |
|
|
RewriteBucketAndKeyPath |
bucketFilterCallback, |
|
|
Boolean |
fastMode |
|
) |
| |
|
inline |
Create and configure a virtual path provider.
- Parameters
-
s3client | Provide the authentication and ecryption settings. For public buckets, no settings are required. Use AmazonS3Config.CommunicationProtocol=HTTP for best performance. |
virtualFilesystemPrefix | The virtual folder to allow client access of s3 from. |
absoluteMetadataExpiration | |
slidingMetadataExpiration | |
bucketFilterCallback | You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path. |
fastMode | If true, existence of bucket and key is assumed as long as prefix is present. Also, no modified date information is provided to the image resizer, so the cache never gets updated. Requires 1 request instead of 2 to download the image. |
Definition at line 109 of file S3VirtualPathProvider.cs.
112 this.s3Client = s3client;
113 this.VirtualFilesystemPrefix = virtualFilesystemPrefix;
114 this.MetadataAbsoluteExpiration = absoluteMetadataExpiration;
115 this.MetadataSlidingExpiration = slidingMetadataExpiration;
116 this.PreS3RequestFilter += bucketFilterCallback;
117 this.FastMode = fastMode;
ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.S3VirtualPathProvider |
( |
RewriteBucketAndKeyPath |
bucketFilterCallback, |
|
|
Boolean |
fastMode |
|
) |
| |
|
inline |
Default settings: CommunicationProtocol=HTTP, VirtualFileSystemPrefix = "~/s3", SlidingExpiration = 1h, AbsoluteExpiration = maxvalue No bucket filtering is performed, so any amazon-hosted bucket can be accessed through this provider unless you add a bucket filter.
- Parameters
-
bucketFilterCallback | You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path. |
fastMode | If true, existence of bucket and key is assumed as long as prefix is present. Also, no modified date information is provided to the image resizer, so the cache never gets updated. Requires 1 request instead of 2 to download the image. |
Definition at line 126 of file S3VirtualPathProvider.cs.
129 this.s3Client =
new AmazonS3Client(null,
new AmazonS3Config() { UseSecureStringForAwsSecretKey =
false, CommunicationProtocol = Amazon.S3.Model.Protocol.HTTP });
130 this.PreS3RequestFilter += bucketFilterCallback;
131 this.FastMode = fastMode;
string ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.FilterPath |
( |
string |
path | ) |
|
|
inline |
Execites the PreS3RequestFilter event and returns the result.
- Parameters
-
- Returns
Definition at line 33 of file S3VirtualPathProvider.cs.
35 S3PathEventArgs e =
new S3PathEventArgs(path);
RewriteBucketAndKeyPath PreS3RequestFilter
Important! You should handle this event and throw an exception if a bucket that you do not own is req...
bool ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.IsPathVirtual |
( |
string |
virtualPath | ) |
|
|
inline |
Determines whether a specified virtual path is within the virtual file system.
- Parameters
-
virtualPath | An absolute virtual path. |
- Returns
- true if the virtual path is within the virtual file sytem; otherwise, false.
Definition at line 148 of file S3VirtualPathProvider.cs.
string VirtualFilesystemPrefix
Requests starting with this path will be handled by this virtual path provider. Should be in app-rela...
bool ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.FastMode |
|
getset |
If true, existence of bucket and key is assumed as long as prefix is present. Defaults to true. Also, no modified date information is provided, so the cache never gets updated. Requires 1 request instead of 2 to download the image.
Definition at line 99 of file S3VirtualPathProvider.cs.
TimeSpan ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.MetadataAbsoluteExpiration |
|
getset |
Existence and modified date metadata about files is cached for, at longest, this amount of time after it is first stored.
Definition at line 54 of file S3VirtualPathProvider.cs.
TimeSpan ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.MetadataSlidingExpiration |
|
getset |
Existence and modified date metadata about files is cached for this long after it is last accessed.
Definition at line 70 of file S3VirtualPathProvider.cs.
AmazonS3Client ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.S3Client |
|
getset |
Gets and sets the AmazonS3Client object that specifies connection details such as authentication, encryption, etc.
Definition at line 89 of file S3VirtualPathProvider.cs.
string ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.VirtualFilesystemPrefix |
|
getset |
Requests starting with this path will be handled by this virtual path provider. Should be in app-relative form: "~/s3/". Will be converted to root-relative form upon assigment. Trailing slash required, auto-added.
Definition at line 45 of file S3VirtualPathProvider.cs.
RewriteBucketAndKeyPath ImageResizer.Plugins.S3Reader.S3VirtualPathProvider.PreS3RequestFilter |
Important! You should handle this event and throw an exception if a bucket that you do not own is requested. Otherwise other people's buckets could be accessed using your server.
Definition at line 26 of file S3VirtualPathProvider.cs.
The documentation for this class was generated from the following file: