The Files component is an abstraction of file storage with a default implementation using AWS S3. This also provides a much simplified API while making the underlying implementation swappable.


This component is currently stable. Following limitations, current work, planned features apply.

Feature Status Description
Binary In-Progress Ability to store/retrieve binary files. ( you can still use the underlying AWS provider to so )
Names Upcoming Ability to enforce a naming convention on the file names
Async Upcoming Async support via Kotlin suspend/coroutines and Java AWS 2.0 SDK
URI Upcoming Ability to use Slate Kit Uri for explicit references to file paths

Back to top


    repositories {
        // other repositories
        maven { url  "" }

    dependencies {
        // other dependencies ...

        compile 'com.slatekit:slatekit-cloud:1.0.0'
git slatekit/src/lib/kotlin/slatekit-cloud
docs Files
uses slatekit.results, slatekit.core,
license Apache 2.0
example Example_Cloud_Files.kt

Back to top


This component uses the following other Slate Kit and/or third-party components.

Component Description
Results To model successes and failures with optional status codes
Utils Common utilities for both android + server

Back to top



Back to top


    // Not storing any key/secret in source code for security purposes
    // Setup 1: Use the default aws config file in "{user_dir}/.aws/credentials"
    val files1 = AwsCloudFiles("app1-files-1", "slatekit", false)

    // Setup 2: Use the type safe config in "{user_id}/myapp/conf/files.conf"
    // Specify the api key section as "sqs"
    val files2 = AwsCloudFiles("app1-files-1", "slatekit",false, "user://myapp/conf/files.conf", "s3")

    // Setup 2: Use the type safe config in "{user_id}/myapp/conf/files.conf"
    // Specify the api key section as "sqs"
    val files3 = AwsCloudFiles("app1-files-1", "slatekit",false, "user://myapp/conf/files.conf", "s3-1")

Back to top


    // Use case 1: Connect using parameters

    // Use case 2: create using just name and content
    files1.create("file-1", "content 1")

    // Use case 3: update using just name and content
    files1.update("file-1", "content 2")

    // Use case 4: create using folder and file name
    files1.create("folder-1", "file-1", "content 1")

    // Use case 5: update using folder and file name
    files1.update("folder-1", "file-1", "content 2")

    // Use case 6: get file as a text using just name

    // Use case 7: get file using folder and file name
    files1.getAsText("folder-1", "file-1")

    // Use case 8: download file to local folder"file-1", "~/dev/temp/")

    // Use case 9: download using folder and file name to local folder"folder-1", "file-1", "~/dev/temp")

    // Use case 10: delete file by just the name

    // Use case 11: delete using folder and name
    files1.delete("folder-1", "file-1")

Back to top