WriteableRevFileRegistry
Write access for a revisioned file registry.
See also
Inheritors
Functions
Link copied to clipboard
fun WriteableRevFileRegistry.file(file: File, contentType: ContentType = ContentType.defaultForFile(file), name: String = file.name): RevisionedFile
Creates a new RevisionedFile from the given file and adds it to this WriteableRevFileRegistry.
Link copied to clipboard
abstract fun register(originalName: String, contentType: ContentType, content: OutgoingContent.ReadChannelContent): RevisionedFile
Registers and returns a revisioned file. This is the most general function to create a revisioned file.
Link copied to clipboard
fun WriteableRevFileRegistry.resource(resource: String, name: String = resource.substringAfterLast('/'), contentType: ContentType = ContentType.defaultForFilePath(resource), classLoader: ClassLoader = checkNotNull(this::class.java.classLoader) {
"Failed to get a class loader for loading resource '$resource'."
}): RevisionedFile
Creates a new RevisionedFile from the given JVM resource and adds it to this WriteableRevFileRegistry.
Link copied to clipboard
fun WriteableRevFileRegistry.source(originalName: String, contentType: ContentType = ContentType.defaultForFilePath(originalName), content: () -> Source): RevisionedFile
fun WriteableRevFileRegistry.source(path: Path, contentType: ContentType = ContentType.defaultForFilePath(path.toString()), originalName: String = path.name, fileSystem: FileSystem = SystemFileSystem): RevisionedFile
Creates a new RevisionedFile from the given source and adds it to this WriteableRevFileRegistry.
Link copied to clipboard
fun WriteableRevFileRegistry.uri(uri: URI, name: String = uri.toString().substringAfterLast('/'), contentType: ContentType = ContentType.defaultForFilePath(uri.path)): RevisionedFile
Creates a new RevisionedFile from the given URI and adds it to this WriteableRevFileRegistry.
Link copied to clipboard
fun WriteableRevFileRegistry.url(url: URL, name: String = url.toString().substringAfterLast('/'), contentType: ContentType = ContentType.defaultForFilePath(url.path)): RevisionedFile
Creates a new RevisionedFile from the given URL and adds it to this WriteableRevFileRegistry.