コード例 #1
0
ファイル: S3Reader.cs プロジェクト: timgaunt/resizer
        /// <summary>
        /// Executes the PreS3RequestFilter event and returns the result.
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public string FilterPath(string path)
        {
            S3PathEventArgs e = new S3PathEventArgs(path);

            if (PreS3RequestFilter != null)
            {
                PreS3RequestFilter(this, e);
            }
            return(e.Path);
        }
コード例 #2
0
ファイル: S3Reader.cs プロジェクト: timgaunt/resizer
        public S3PathEventArgs ParseAndFilterPath(string virtualPath)
        {
            var path = StripPrefix(virtualPath);

            var e = new S3PathEventArgs(path);

            if (PreS3RequestFilter != null)
            {
                PreS3RequestFilter(this, e);
            }

            if (string.IsNullOrEmpty(e.Bucket))
            {
                throw new ArgumentException("S3 path must specify a bucket" + e.Path);
            }
            if (string.IsNullOrEmpty(e.Key))
            {
                throw new ArgumentException("S3 path must specify a key" + e.Path);
            }
            return(e);
        }
コード例 #3
0
ファイル: S3Reader.cs プロジェクト: timgaunt/resizer
 void S3Reader2_PreS3RequestFilter(S3Reader2 sender, S3PathEventArgs e)
 {
     e.AssertBucketMatches(AllowedBuckets);
 }
コード例 #4
0
 /// <summary>
 /// Execites the PreS3RequestFilter event and returns the result.
 /// </summary>
 /// <param name="path"></param>
 /// <returns></returns>
 public string FilterPath(string path)
 {
     S3PathEventArgs e = new S3PathEventArgs(path);
     if (PreS3RequestFilter != null) PreS3RequestFilter(this,e);
     return e.Path;
 }