Ejemplo n.º 1
0
 /// <summary>
 /// 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.
 /// </summary>
 /// <param name="bucketFilterCallback">You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path.</param>
 /// <param name="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.</param>
 public S3VirtualPathProvider(RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode)
     : base()
 {
     this.s3Client = new AmazonS3Client(null,new AmazonS3Config() { UseSecureStringForAwsSecretKey = false, CommunicationProtocol = Amazon.S3.Model.Protocol.HTTP });
     this.PreS3RequestFilter += bucketFilterCallback;
     this.FastMode = fastMode;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Create and configure a virtual path provider. 
 /// </summary>
 /// <param name="s3client">Provide the authentication and ecryption settings. For public buckets, no settings are required. Use AmazonS3Config.CommunicationProtocol=HTTP for best performance. </param>
 /// <param name="virtualFilesystemPrefix">The virtual folder to allow client access of s3 from.</param>
 /// <param name="absoluteMetadataExpiration"></param>
 /// <param name="slidingMetadataExpiration"></param>
 /// <param name="bucketFilterCallback">You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path.</param>
 /// <param name="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.</param>
 public S3VirtualPathProvider(AmazonS3Client s3client, String virtualFilesystemPrefix, TimeSpan absoluteMetadataExpiration, TimeSpan slidingMetadataExpiration, RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode)
     : base()
 {
     this.s3Client = s3client;
     this.VirtualFilesystemPrefix = virtualFilesystemPrefix;
     this.MetadataAbsoluteExpiration = absoluteMetadataExpiration;
     this.MetadataSlidingExpiration = slidingMetadataExpiration;
     this.PreS3RequestFilter += bucketFilterCallback;
     this.FastMode = fastMode;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// 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.
 /// </summary>
 /// <param name="bucketFilterCallback">You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path.</param>
 /// <param name="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.</param>
 public S3VirtualPathProvider(RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode)
     : base()
 {
     this.s3Client = new AmazonS3Client(null, new AmazonS3Config()
     {
         UseSecureStringForAwsSecretKey = false, CommunicationProtocol = Amazon.S3.Model.Protocol.HTTP
     });
     this.PreS3RequestFilter += bucketFilterCallback;
     this.FastMode            = fastMode;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Create and configure a virtual path provider.
 /// </summary>
 /// <param name="s3client">Provide the authentication and ecryption settings. For public buckets, no settings are required. Use AmazonS3Config.CommunicationProtocol=HTTP for best performance. </param>
 /// <param name="virtualFilesystemPrefix">The virtual folder to allow client access of s3 from.</param>
 /// <param name="absoluteMetadataExpiration"></param>
 /// <param name="slidingMetadataExpiration"></param>
 /// <param name="bucketFilterCallback">You should validate that the requested bucket is your own. If you only want one bucket, just prefix your bucket to the path.</param>
 /// <param name="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.</param>
 public S3VirtualPathProvider(AmazonS3Client s3client, String virtualFilesystemPrefix, TimeSpan absoluteMetadataExpiration, TimeSpan slidingMetadataExpiration, RewriteBucketAndKeyPath bucketFilterCallback, Boolean fastMode)
     : base()
 {
     this.s3Client = s3client;
     this.VirtualFilesystemPrefix    = virtualFilesystemPrefix;
     this.MetadataAbsoluteExpiration = absoluteMetadataExpiration;
     this.MetadataSlidingExpiration  = slidingMetadataExpiration;
     this.PreS3RequestFilter        += bucketFilterCallback;
     this.FastMode = fastMode;
 }