Class to allow modifying the bucket and key request path
More...
|
| S3PathEventArgs (string path) |
| Create a new instance of S3PathEventArgs for modifying the bucket and key of incoming requests More...
|
|
void | AssertBucketMatches (params string[] buckets) |
| Stops the request if it doesn't match one of the allowed buckets. Amazon S3 is case-sensitive. Thus, comparisons are case sensitive as well. To minimize headache, a different exception is thrown when only case differs. More...
|
|
void | ThrowException () |
| Throws an HTTP 403 Not Authorized exception. Call this if an invalid bucket request comes through. More...
|
|
void | ThrowInvalidCaseException () |
| Like ThrowException, but hints that the bucket casing is wrong. More...
|
|
void | PrefixBucket (String bucket) |
| Prefixes the specified bucket to the requested path. More...
|
|
|
string | Path [get, set] |
| Path contains the bucket and key in the form "bucket/key". Where key may contain additional forward slashes. More...
|
|
string | Bucket [get] |
| Parses the bucket from Path More...
|
|
string | Key [get] |
| Parses the key from Path More...
|
|
Class to allow modifying the bucket and key request path
Definition at line 14 of file S3PathEventArgs.cs.
ImageResizer.Plugins.S3Reader.S3PathEventArgs.S3PathEventArgs |
( |
string |
path | ) |
|
|
inline |
void ImageResizer.Plugins.S3Reader.S3PathEventArgs.AssertBucketMatches |
( |
params string[] |
buckets | ) |
|
|
inline |
Stops the request if it doesn't match one of the allowed buckets. Amazon S3 is case-sensitive. Thus, comparisons are case sensitive as well. To minimize headache, a different exception is thrown when only case differs.
- Parameters
-
Definition at line 36 of file S3PathEventArgs.cs.
40 foreach (
string s
in buckets)
if (s.Equals(b,StringComparison.InvariantCulture)) { found =
true;
break; }
42 if (!found)
foreach (
string s
in buckets)
if (s.Equals(b, StringComparison.InvariantCultureIgnoreCase)) {
ThrowInvalidCaseException(); }
void ThrowInvalidCaseException()
Like ThrowException, but hints that the bucket casing is wrong.
string Bucket
Parses the bucket from Path
void ThrowException()
Throws an HTTP 403 Not Authorized exception. Call this if an invalid bucket request comes through...
void ImageResizer.Plugins.S3Reader.S3PathEventArgs.PrefixBucket |
( |
String |
bucket | ) |
|
|
inline |
Prefixes the specified bucket to the requested path.
- Parameters
-
Definition at line 65 of file S3PathEventArgs.cs.
66 bucket = bucket.Trim(
'\\',
'/');
67 Path = bucket +
"/" + Path.TrimStart(
'/');
string Path
Path contains the bucket and key in the form "bucket/key". Where key may contain additional forward s...
void ImageResizer.Plugins.S3Reader.S3PathEventArgs.ThrowException |
( |
| ) |
|
|
inline |
Throws an HTTP 403 Not Authorized exception. Call this if an invalid bucket request comes through.
Definition at line 50 of file S3PathEventArgs.cs.
51 throw new ImageProcessingException(403,
"You have not permitted access to this amazon S3 bucket.");
void ImageResizer.Plugins.S3Reader.S3PathEventArgs.ThrowInvalidCaseException |
( |
| ) |
|
|
inline |
Like ThrowException, but hints that the bucket casing is wrong.
Definition at line 57 of file S3PathEventArgs.cs.
58 throw new FileNotFoundException(
"Amazon S3 is case sensitive. Check your requested bucket name to verify correct casing.");
string ImageResizer.Plugins.S3Reader.S3PathEventArgs.Bucket |
|
get |
string ImageResizer.Plugins.S3Reader.S3PathEventArgs.Key |
|
get |
string ImageResizer.Plugins.S3Reader.S3PathEventArgs.Path |
|
getset |
Path contains the bucket and key in the form "bucket/key". Where key may contain additional forward slashes.
Definition at line 27 of file S3PathEventArgs.cs.
The documentation for this class was generated from the following file: