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).
Quick start
Section titled “Quick start”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")FilesystemManager files = app.resolve(FilesystemManager.class);FilesystemAdapter disk = files.disk();
disk.put("reports/q1.txt", "ok");String body = disk.getString("reports/q1.txt");boolean present = disk.exists("reports/q1.txt");boolean gone = disk.missing("reports/nope.txt");Executable config lives in config/Filesystems (see Config & env). Relative root values resolve against the application base path.
Drivers at a glance
Section titled “Drivers at a glance”| 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.