Skip to content
Kona

Filesystem

Kona stores files on named disks. A disk is a root (folder or cloud bucket) plus a small API: put and get bytes, list directories, build URLs, and more. Resolve disks through FilesystemManager after FilesystemServiceProvider is registered (kona new does this for you).

val files = app.resolve(FilesystemManager::class.java)
val disk = files.disk() // default disk from config
disk.put("reports/q1.txt", "ok")
val body = disk.getString("reports/q1.txt")
val present = disk.exists("reports/q1.txt")
val gone = disk.missing("reports/nope.txt")

Executable config lives in config/Filesystems (see Config & env). Relative root values resolve against the application base path.

Driver Role
local Files under a directory (default storage/app)
public Local disk defaulting to storage/app/public with URL prefix /storage
scoped Path prefix over another disk
memory / s3-memory In-process S3-shaped store for tests
s3 Path-style HTTP client with AWS SigV4 (endpoint, bucket, key, secret, region, optional prefix)

Any disk may set read-only / read_only to true to reject writes.

Next: configuration, working with files, public disk & temporary URLs, and testing.