MutableMediaStorage

class MutableMediaStorage(options: MediaStorageOptions, nameProvider: MediaNameProviderStrategy = SanitizedMediaNameProvider()) : ReadOnlyMediaStorage

A media storage that can be modified with new entries.

Parameters

options

storage rules

nameProvider

strategy used to generate media names. The name of a media defines the file name in the output directory, hence this is the resource the document should refer to (e.g. images).

Constructors

Link copied to clipboard
constructor(options: MediaStorageOptions, nameProvider: MediaNameProviderStrategy = SanitizedMediaNameProvider())

Properties

Link copied to clipboard
open override val all: Set<StoredMedia>

All the stored entries.

Link copied to clipboard
open val isEmpty: Boolean

Whether this storage does not contain any media.

Link copied to clipboard
open override val name: String

The name of the storage. It also defines the name of the subdirectory in the output directory where media from this storage is saved.

Functions

Link copied to clipboard
fun register(path: String, workingDirectory: File?): StoredMedia?

Registers a media by its path. The corresponding media is resolved lazily from the path.

Link copied to clipboard
open override fun resolve(path: String): StoredMedia?

Resolves a media by its path.

Link copied to clipboard
open override fun toResource(): OutputResource

Converts this storage to an OutputResource. This is used to export all media to the output directory. Ideally, this method returns an com.quarkdown.core.pipeline.output.OutputResourceGroup which contains all media inside of it.