CKFinder 3 – ASP.NET Connector Documentation
AmazonStorage Class Reference

An Amazon S3 file system. More...

Inheritance diagram for AmazonStorage:
IFileSystem

Public Member Functions

 AmazonStorage (string bucket, string root="/")
 Constructs a new instance of AmazonStorage. More...
 
 AmazonStorage (string secret, string key, string bucket, string region)
 Constructs a new instance of AmazonStorage. More...
 
 AmazonStorage (string secret, string key, string bucket, string region, string root, string signatureVersion="4")
 Constructs a new instance of AmazonStorage. More...
 
async Task CreateFolderAsync (string path, CancellationToken cancellationToken)
 Asynchronously creates new folder. More...
 
async Task DeleteFileAsync (string path, CancellationToken cancellationToken)
 Asynchronously deletes a file. More...
 
async Task DeleteFolderAsync (string path, CancellationToken cancellationToken)
 Asynchronously deletes a folder. More...
 
async Task DeleteFolderAsync (string path, Action< int, int > progressAction, CancellationToken cancellationToken)
 Asynchronously deletes a folder. More...
 
async Task MoveFileAsync (string srcPath, string destPath, CancellationToken cancellationToken)
 Asynchronously moves a file. More...
 
async Task MoveFolderAsync (string srcPath, string destPath, CancellationToken cancellationToken)
 Asynchronously moves a folder. More...
 
async Task MoveFolderAsync (string srcPath, string destPath, Action< int, int > progressAction, CancellationToken cancellationToken)
 Asynchronously moves a folder. More...
 
async Task CopyFileAsync (string srcPath, string destPath, CancellationToken cancellationToken)
 Asynchronously copies a file. More...
 
async Task< bool > FileExistsAsync (string path, CancellationToken cancellationToken)
 Asynchronously checks whether a file exists. More...
 
async Task< bool > FolderExistsAsync (string path, CancellationToken cancellationToken)
 Asynchronously checks whether a folder exists. More...
 
async Task WriteAsync (Stream fileStream, string path, CancellationToken cancellationToken)
 Asynchronously writes file content. More...
 
async Task< Stream > ReadAsync (string path, CancellationToken cancellationToken)
 Asynchronously reads file content. More...
 
Task< FolderListResultGetFolderInfosAsync (string path, CancellationToken cancellationToken)
 Asynchronously lists folder informations. More...
 
Task< FolderListResultGetFolderInfosAsync (IFolderListContinuation folderListContinuation, CancellationToken cancellationToken)
 Asynchronously lists folder informations. More...
 
Task< FileListResultGetFileInfosAsync (string path, CancellationToken cancellationToken)
 Asynchronously lists file informations. More...
 
Task< FileListResultGetFileInfosAsync (IFileListContinuation fileListContinuation, CancellationToken cancellationToken)
 Asynchronously lists file informations. More...
 
async Task< FolderInfoGetFolderInfoAsync (string path, CancellationToken cancellationToken)
 Asychronously gets folder information. More...
 
async Task< FileInfoGetFileInfoAsync (string path, CancellationToken cancellationToken)
 Asychronously gets file information. More...
 
Task< string > GetUrlAsync (string path, CancellationToken cancellationToken)
 Asynchronously gets resource URL. May return null if URL is not available. More...
 

Protected Member Functions

virtual AmazonS3Client createClient ()
 Creates AmazonS3Client instance. More...
 

Protected Attributes

readonly string _root
 
readonly string _bucket
 
readonly string _region
 
readonly string _signatureVersion
 
readonly AWSCredentials _credentials
 

Detailed Description

An Amazon S3 file system.

Constructor & Destructor Documentation

◆ AmazonStorage() [1/3]

AmazonStorage ( string  bucket,
string  root = "/" 
)
inline

Constructs a new instance of AmazonStorage.

Parameters
bucketA name of the bucket.
rootA root folder in the S3 account for the file system

◆ AmazonStorage() [2/3]

AmazonStorage ( string  secret,
string  key,
string  bucket,
string  region 
)
inline

Constructs a new instance of AmazonStorage.

Parameters
secretA secret for Amazon S3 account.
keyA key to the Amazon S3 account.
bucketA name of the bucket.
regionA name of the S3 region.

◆ AmazonStorage() [3/3]

AmazonStorage ( string  secret,
string  key,
string  bucket,
string  region,
string  root,
string  signatureVersion = "4" 
)
inline

Constructs a new instance of AmazonStorage.

Parameters
secretA secret for Amazon S3 account.
keyA key to the Amazon S3 account.
bucketA name of the bucket.
regionA name of the S3 region.
rootA root folder in the S3 account for the file system.

Member Function Documentation

◆ CopyFileAsync()

async Task CopyFileAsync ( string  srcPath,
string  destPath,
CancellationToken  cancellationToken 
)
inline

Asynchronously copies a file.

Parameters
srcPathA path to the file.
destPathA path to the destination file.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ createClient()

virtual AmazonS3Client createClient ( )
inlineprotectedvirtual

Creates AmazonS3Client instance.

Returns

◆ CreateFolderAsync()

async Task CreateFolderAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously creates new folder.

Parameters
pathA path to the new folder.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ DeleteFileAsync()

async Task DeleteFileAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously deletes a file.

Parameters
pathA path to the file.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ DeleteFolderAsync() [1/2]

async Task DeleteFolderAsync ( string  path,
Action< int, int >  progressAction,
CancellationToken  cancellationToken 
)
inline

Asynchronously deletes a folder.

Parameters
pathA path to the folder.
progressActionAn action fired when progress is updated.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ DeleteFolderAsync() [2/2]

async Task DeleteFolderAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously deletes a folder.

Parameters
pathA path to the folder.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ FileExistsAsync()

async Task<bool> FileExistsAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously checks whether a file exists.

Parameters
pathA path to the file.
cancellationTokenA cancellation token.
Returns
True if file exists, false otherwise.

Implements IFileSystem.

◆ FolderExistsAsync()

async Task<bool> FolderExistsAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously checks whether a folder exists.

Parameters
pathA path to the folder.
cancellationTokenA cancellation token.
Returns
True if folder exists, false otherwise.

Implements IFileSystem.

◆ GetFileInfoAsync()

async Task<FileInfo> GetFileInfoAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asychronously gets file information.

Parameters
pathA path to the file.
cancellationTokenA cancellation token.
Returns
A file information.

Implements IFileSystem.

◆ GetFileInfosAsync() [1/2]

Task<FileListResult> GetFileInfosAsync ( IFileListContinuation  fileListContinuation,
CancellationToken  cancellationToken 
)
inline

Asynchronously lists file informations.

Parameters
fileListContinuationA file list continuation.
cancellationTokenA cancellation token.
Returns
A file list result.

Implements IFileSystem.

◆ GetFileInfosAsync() [2/2]

Task<FileListResult> GetFileInfosAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously lists file informations.

Parameters
pathA path to the folder.
cancellationTokenA cancellation token.
Returns
A file list result.

Implements IFileSystem.

◆ GetFolderInfoAsync()

async Task<FolderInfo> GetFolderInfoAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asychronously gets folder information.

Parameters
pathA path to the folder.
cancellationTokenA cancellation token.
Returns
A folder information.

Implements IFileSystem.

◆ GetFolderInfosAsync() [1/2]

Task<FolderListResult> GetFolderInfosAsync ( IFolderListContinuation  folderListContinuation,
CancellationToken  cancellationToken 
)
inline

Asynchronously lists folder informations.

Parameters
folderListContinuationA folder list continuation.
cancellationTokenA cancellation token.
Returns
A folder list result.

Implements IFileSystem.

◆ GetFolderInfosAsync() [2/2]

Task<FolderListResult> GetFolderInfosAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously lists folder informations.

Parameters
pathA path to the folder.
cancellationTokenA cancellation token.
Returns
A folder list result.

Implements IFileSystem.

◆ GetUrlAsync()

Task<string> GetUrlAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously gets resource URL. May return null if URL is not available.

Parameters
pathA path to the resource.
cancellationTokenA cancellation token.
Returns
An URL to the resource or null if URL is not available.

Implements IFileSystem.

◆ MoveFileAsync()

async Task MoveFileAsync ( string  srcPath,
string  destPath,
CancellationToken  cancellationToken 
)
inline

Asynchronously moves a file.

Parameters
srcPathA path to the file.
destPathA path to the destination file.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ MoveFolderAsync() [1/2]

async Task MoveFolderAsync ( string  srcPath,
string  destPath,
Action< int, int >  progressAction,
CancellationToken  cancellationToken 
)
inline

Asynchronously moves a folder.

Parameters
srcPathA path to the folder.
destPathA path to the destination folder.
progressActionAn action fired when progress is updated.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ MoveFolderAsync() [2/2]

async Task MoveFolderAsync ( string  srcPath,
string  destPath,
CancellationToken  cancellationToken 
)
inline

Asynchronously moves a folder.

Parameters
srcPathA path to the folder.
destPathA path to the destination folder.
cancellationTokenA cancellation token.

Implements IFileSystem.

◆ ReadAsync()

async Task<Stream> ReadAsync ( string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously reads file content.

Parameters
pathA path to the file.
cancellationTokenA cancellation token.
Returns
A stream with file content.

Implements IFileSystem.

◆ WriteAsync()

async Task WriteAsync ( Stream  fileStream,
string  path,
CancellationToken  cancellationToken 
)
inline

Asynchronously writes file content.

Parameters
fileStreamA stream with content to write.
pathA path to the file.
cancellationTokenA cancellation token.

Implements IFileSystem.


The documentation for this class was generated from the following file: