コード例 #1
0
        internal DataStore CreateDataStore(OptimizeImageItem item, bool keepPath = false)
        {
            string path;

            if (OptimizeImageItems != null)
            {
                //note: ExternalStoragePath will be ignored when using keepPath
                path = HelperFunctions.BuildPathS3(item.Path, keepPath, item.ExternalStoragePath, AmazonBucket);
            }
            else
            {
                path = HelperFunctions.BuildPathS3(item.Path, keepPath, S3Path, AmazonBucket);
            }

            var ds = new DataStore(AmazonKey, AmazonSecret, AmazonBucket, AmazonRegion)
            {
                Path = path
            };

            //todo: refactor
            if (OptimizeImageItems != null)
            {
                ds = SetHeadersMetadata(ds, item.Headers, item.Metadata) as DataStore;
            }
            else
            {
                ds = SetHeadersMetadata(ds, Headers, Metadata) as DataStore;
            }

            return(ds);
        }
コード例 #2
0
        internal DataStore CreateDataStore(OptimizeImageItem item, bool keepPath = false)
        {
            string path;

            if (OptimizeImageItems != null)
            {
                //note: ExternalStoragePath will be ignored when using keepPath
                path = HelperFunctions.BuildPathAzure(item.Path, keepPath, item.ExternalStoragePath, AzureContainer);
            }
            else
            {
                path = HelperFunctions.BuildPathAzure(item.Path, keepPath, AzurePath, AzureContainer);
            }

            var ds = new DataStore(AzureAccount, AzureKey, AzureContainer, path);

            //todo: refactor
            if (OptimizeImageItems != null)
            {
                ds = SetHeadersMetadata(ds, item.Headers, item.Metadata) as DataStore;
            }
            else
            {
                ds = SetHeadersMetadata(ds, Headers, Metadata) as DataStore;
            }

            return(ds);
        }