FakeResourceLoaderBackend

class FakeResourceLoaderBackend(fakeResources: Map<String, String>) : ResourceLoader.Backend

A fake ResourceLoader.Backend loads resources from an in-memory map. This does not have the same well-formed filepath guarantees that FakeFilesystemLoaderBackend provides, which assumes resource paths are file-like and will throw exceptions for malformed resource paths

Constructors

Link copied to clipboard
constructor(fakeResources: Map<String, String>)

Functions

Link copied to clipboard
open fun all(): Set<String>
Link copied to clipboard
open override fun checkPath(path: String)
Link copied to clipboard
open override fun exists(path: String): Boolean
Link copied to clipboard
open override 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)