Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 void S3Reader2_PreS3RequestFilter(S3Reader2 sender, S3PathEventArgs e)
 {
     e.AssertBucketMatches(AllowedBuckets);
 }
 /// <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;
 }