public Stream OpenReadStream()
        {
            AmazonS3FileStorageProvider s3 = CentralizedFileStorage.GetFileStore(this.FileStoreKey) as AmazonS3FileStorageProvider;

            if (s3 != null)
            {
                return(s3.GetContentStream(this.Path, this.FileName));
            }
            else
            {
                return(null);
            }
        }
        public string GetDownloadUrl()
        {
            AmazonS3FileStorageProvider s3 = CentralizedFileStorage.GetFileStore(this.FileStoreKey) as AmazonS3FileStorageProvider;

            if (s3 != null)
            {
                return(s3.GetDownloadUrl(this.Path, this.FileName));
            }
            else
            {
                return(string.Empty);
            }
        }
 private ApplicationException CreateFilePathInvalidException(string path, string fileName)
 {
     return new ApplicationException(string.Format("The provided path and/or file name is invalid. File store key {0}, path {1}, file name {2}", (object)AmazonS3FileStorageProvider.ValueForLog(this.FileStoreKey), (object)AmazonS3FileStorageProvider.ValueForLog(path), (object)AmazonS3FileStorageProvider.ValueForLog(fileName)));
 }