Innovt Platform
Search Results for

    Show / Hide Table of Contents

    Interface IFileSystem

    Interface for File System

    Namespace: Innovt.Cloud.File
    Assembly: Innovt.Cloud.dll
    Syntax
    public interface IFileSystem

    Methods

    | Edit this page View Source

    CopyObject(string, string, string, string, string, string, CancellationToken)

    Copy a file from one bucket to another

    Declaration
    Task<bool> CopyObject(string sourceBucket, string sourceKey, string destinationBucket, string destinationKey, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string sourceBucket
    string sourceKey
    string destinationBucket
    string destinationKey
    string serverSideEncryptionMethod
    string fileAcl
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>
    | Edit this page View Source

    DeleteObject(string, string)

    Deletes an object from the specified bucket.

    Declaration
    bool DeleteObject(string bucketName, string key)
    Parameters
    Type Name Description
    string bucketName
    string key
    Returns
    Type Description
    bool
    | Edit this page View Source

    DeleteObjectAsync(string, string, CancellationToken)

    Deletes an object from the specified bucket.

    Declaration
    Task<bool> DeleteObjectAsync(string bucketName, string key, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName
    string key
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<bool>
    | Edit this page View Source

    Download(string, string, string)

    Downloads a file from the specified bucket and saves it to the destination path.

    Declaration
    void Download(string bucketName, string fileName, string destination)
    Parameters
    Type Name Description
    string bucketName
    string fileName
    string destination
    | Edit this page View Source

    DownloadStream(string)

    Downloads a file from the provided URL and returns the stream.

    Declaration
    Stream DownloadStream(string url)
    Parameters
    Type Name Description
    string url
    Returns
    Type Description
    Stream
    | Edit this page View Source

    DownloadStream(string, string)

    Downloads a file from the specified bucket and file name synchronously and returns the stream.

    Declaration
    Stream DownloadStream(string bucketName, string fileName)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string fileName

    The name of the file to download.

    Returns
    Type Description
    Stream

    The stream of the downloaded file.

    | Edit this page View Source

    DownloadStreamAsync(string, string, CancellationToken)

    Downloads a file from the specified bucket and file name asynchronously and returns the stream.

    Declaration
    Task<Stream> DownloadStreamAsync(string bucketName, string fileName, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string fileName

    The name of the file to download.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<Stream>

    The stream of the downloaded file.

    | Edit this page View Source

    DownloadStreamAsync(string, CancellationToken)

    Downloads a file from the provided URL asynchronously and returns the stream.

    Declaration
    Task<Stream> DownloadStreamAsync(string url, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string url

    The URL of the file to download.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<Stream>

    The stream of the downloaded file.

    | Edit this page View Source

    ExtractBucketFromGetUrl(string)

    Extracts the bucket name and file key from the provided URL.

    Declaration
    (string bucket, string fileKey) ExtractBucketFromGetUrl(string bucketUrl)
    Parameters
    Type Name Description
    string bucketUrl

    The URL containing bucket information.

    Returns
    Type Description
    (string bucket, string fileKey)

    A tuple containing the bucket name and file key.

    | Edit this page View Source

    FileExistsAsync(string, string, CancellationToken)

    Checks if a file exists in the specified bucket asynchronously.

    Declaration
    Task<bool> FileExistsAsync(string bucketName, string key, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string key

    The key of the file.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<bool>

    True if the file exists; otherwise, false.

    | Edit this page View Source

    FolderExists(string, string)

    Checks if a folder exists in the specified bucket.

    Declaration
    bool FolderExists(string bucketName, string key)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string key

    The key of the folder.

    Returns
    Type Description
    bool

    True if the folder exists; otherwise, false.

    | Edit this page View Source

    FolderExistsAsync(string, string, CancellationToken)

    Checks if a folder exists in the specified bucket asynchronously.

    Declaration
    Task<bool> FolderExistsAsync(string bucketName, string key, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string key

    The key of the folder.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<bool>

    True if the folder exists; otherwise, false.

    | Edit this page View Source

    GeneratePreSignedUrl(string, string, DateTime, IDictionary<string, object>)

    Generates a pre-signed URL for accessing the object in the specified bucket.

    Declaration
    string GeneratePreSignedUrl(string bucketName, string key, DateTime expiration, IDictionary<string, object> additionalProperties)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string key

    The key of the object.

    DateTime expiration

    The expiration date and time for the pre-signed URL.

    IDictionary<string, object> additionalProperties

    Additional properties for customizing the URL generation.

    Returns
    Type Description
    string

    The pre-signed URL for accessing the object.

    | Edit this page View Source

    GetObjectContentAsync(string, string, Encoding, CancellationToken)

    Gets the content of the object from the specified URL asynchronously.

    Declaration
    Task<string> GetObjectContentAsync(string bucketName, string key, Encoding encoding, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The Bucket name.

    string key

    The file url

    Encoding encoding
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<string>
    | Edit this page View Source

    GetObjectContentAsync(string, Encoding, CancellationToken)

    Gets the content of the object from the specified URL asynchronously.

    Declaration
    Task<string> GetObjectContentAsync(string url, Encoding encoding, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string url

    The URL of the object.

    Encoding encoding

    The encoding to use for reading the content.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<string>

    The content of the object as a string.

    | Edit this page View Source

    GetObjectFromJsonAsync<T>(Uri, CancellationToken)

    Deserializes a JSON object from the content of a file specified by a URI.

    Declaration
    Task<T> GetObjectFromJsonAsync<T>(Uri filePath, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    Uri filePath

    The URI pointing to the JSON file.

    CancellationToken cancellationToken
    Returns
    Type Description
    Task<T>

    The deserialized object of type T.

    Type Parameters
    Name Description
    T

    The type of the object to deserialize to.

    | Edit this page View Source

    GetPreSignedUrl(string, string, DateTime)

    Gets a pre-signed URL for accessing the object in the specified bucket.

    Declaration
    string GetPreSignedUrl(string bucketName, string key, DateTime expires)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string key

    The key of the object.

    DateTime expires

    The expiration date and time for the pre-signed URL.

    Returns
    Type Description
    string

    The pre-signed URL for accessing the object.

    | Edit this page View Source

    PutObject(string, Stream, string, string, string, string)

    Uploads a file from a stream to the specified bucket.

    Declaration
    string PutObject(string bucketName, Stream stream, string fileName, string contentType = null, string serverSideEncryptionMethod = null, string fileAcl = null)
    Parameters
    Type Name Description
    string bucketName
    Stream stream
    string fileName
    string contentType
    string serverSideEncryptionMethod
    string fileAcl
    Returns
    Type Description
    string
    | Edit this page View Source

    PutObject(string, string, string, string, string)

    Uploads a file from a local file path to the specified bucket.

    Declaration
    string PutObject(string bucketName, string filePath, string contentType = null, string serverSideEncryptionMethod = null, string fileAcl = null)
    Parameters
    Type Name Description
    string bucketName
    string filePath
    string contentType
    string serverSideEncryptionMethod
    string fileAcl
    Returns
    Type Description
    string
    | Edit this page View Source

    PutObjectAsync(string, Stream, string, string, string, string, CancellationToken)

    Uploads an object from a stream to the specified bucket asynchronously.

    Declaration
    Task<string> PutObjectAsync(string bucketName, Stream stream, string fileName, string contentType = null, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    Stream stream

    The stream containing the object to upload.

    string fileName

    The name of the file to upload.

    string contentType

    The content type of the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<string>

    The unique identifier of the uploaded object.

    | Edit this page View Source

    PutObjectAsync(string, string, string, string, string, CancellationToken)

    Uploads an object from a local file to the specified bucket asynchronously.

    Declaration
    Task<string> PutObjectAsync(string bucketName, string filePath, string contentType = null, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string filePath

    The local file path of the object to upload.

    string contentType

    The content type of the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<string>

    The unique identifier of the uploaded object.

    | Edit this page View Source

    Upload(string, Stream, string, IList<KeyValuePair<string, string>>, string, string)

    Uploads an object from a stream to the specified bucket synchronously.

    Declaration
    string Upload(string bucketName, Stream stream, string fileName, IList<KeyValuePair<string, string>> metadata = null, string serverSideEncryptionMethod = null, string fileAcl = null)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    Stream stream

    The stream containing the object to upload.

    string fileName

    The name of the file to upload.

    IList<KeyValuePair<string, string>> metadata

    Metadata for the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    Returns
    Type Description
    string

    The unique identifier of the uploaded object.

    | Edit this page View Source

    Upload(string, string, IList<KeyValuePair<string, string>>, string, string)

    Uploads an object from a local file to the specified bucket synchronously.

    Declaration
    string Upload(string bucketName, string filePath, IList<KeyValuePair<string, string>> metadata = null, string serverSideEncryptionMethod = null, string fileAcl = null)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string filePath

    The local file path of the object to upload.

    IList<KeyValuePair<string, string>> metadata

    Metadata for the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    Returns
    Type Description
    string

    The unique identifier of the uploaded object.

    | Edit this page View Source

    UploadAsJsonAsync<T>(string, T, string, IList<KeyValuePair<string, string>>, string, string, CancellationToken)

    Uploads an object as JSON to the specified bucket.

    Declaration
    Task<string> UploadAsJsonAsync<T>(string bucketName, T obj, string fileName, IList<KeyValuePair<string, string>> metadata = null, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName
    T obj
    string fileName
    IList<KeyValuePair<string, string>> metadata
    string serverSideEncryptionMethod
    string fileAcl
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<string>
    Type Parameters
    Name Description
    T
    | Edit this page View Source

    UploadAsync(string, Stream, string, IList<KeyValuePair<string, string>>, string, string, CancellationToken)

    Uploads an object from a stream to the specified bucket asynchronously.

    Declaration
    Task<string> UploadAsync(string bucketName, Stream stream, string fileName, IList<KeyValuePair<string, string>> metadata = null, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    Stream stream

    The stream containing the object to upload.

    string fileName

    The name of the file to upload.

    IList<KeyValuePair<string, string>> metadata

    Metadata for the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<string>

    The unique identifier of the uploaded object.

    | Edit this page View Source

    UploadAsync(string, string, IList<KeyValuePair<string, string>>, string, string, CancellationToken)

    Uploads an object from a local file to the specified bucket asynchronously.

    Declaration
    Task<string> UploadAsync(string bucketName, string filePath, IList<KeyValuePair<string, string>> metadata = null, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName

    The name of the bucket.

    string filePath

    The local file path of the object to upload.

    IList<KeyValuePair<string, string>> metadata

    Metadata for the object.

    string serverSideEncryptionMethod

    The server-side encryption method to use.

    string fileAcl

    The access control for the object.

    CancellationToken cancellationToken

    The cancellation token to cancel the asynchronous operation.

    Returns
    Type Description
    Task<string>

    The unique identifier of the uploaded object.

    | Edit this page View Source

    UploadDirectoryAsync(string, string, string, string, CancellationToken)

    Uploads all files in a directory to the specified bucket.

    Declaration
    Task UploadDirectoryAsync(string bucketName, string directory, string serverSideEncryptionMethod = null, string fileAcl = null, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    string bucketName
    string directory
    string serverSideEncryptionMethod
    string fileAcl
    CancellationToken cancellationToken
    Returns
    Type Description
    Task

    Extension Methods

    Extensions.IsNull(object)
    Extensions.ToStringOrDefault(object)
    SimpleMapper.MapTo<T1>(object)
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX