register

fun register(path: String, media: Media): StoredMedia?

Registers a media by its path.

Return

the StoredMedia associated with the media. If a media was already bound to the path, it is returned. Otherwise, the new media is returned.

Parameters

path

path to the media, either a file or a URL

media

media to register


fun register(path: String, fileSystem: FileSystem): StoredMedia?

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

Return

the StoredMedia associated with the path: the existing binding if the path was already registered, or the newly resolved media otherwise. It may also return null if the media is not accepted into the storage.

Parameters

path

path to the media, either a file or a URL

fileSystem

file system to resolve the media from, in case the path is a local file

See also