FakeFilesystemLoaderBackend

class FakeFilesystemLoaderBackend(files: Map<String, String>) : ResourceLoader.Backend

A fake FilesystemLoaderBackend that loads file contents from an in-memory map. The map can be populated by adding to the ForFakeFiles map.

newMapBinder<String, String>(ForFakeFiles::class).addBinding("/etc/foo.txt").toInstance("hello!")

Constructors

Link copied to clipboard
fun FakeFilesystemLoaderBackend(files: Map<String, String>)

Functions

Link copied to clipboard
open fun all(): Set<String>
Link copied to clipboard
open override fun exists(path: String): Boolean
Link copied to clipboard
open fun list(path: String): List<String>
Link copied to clipboard
open override fun open(path: String): BufferedSource?
Link copied to clipboard
open fun put(path: String, data: ByteString)
Link copied to clipboard
open fun unwatch(path: String)
Link copied to clipboard
open fun watch(path: String, resourceChangedListener: (address: String) -> Unit)