AssetLoader

com.alecdorrington.assetloader.AssetLoader
See theAssetLoader companion object
class AssetLoader

A utility for loading and caching static assets so that they can be served by a web server.

Only intended for use when the total number of assets is small enough to fit comfortably in memory.

Warning: Work with the assumption that all files in assetPath will be made publicly accessible.

Value parameters

assetPath

The root directory on the server's file system where assets are stored, relative to the directory of the running server process.

maxAge

The maximum age (in seconds) for which an asset should be considered fresh for caching purposes. Caching is disabled by default (0).

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def getAsset(path: String): Option[Asset]

Retrieves the asset corresponding to the given path, if it exists.

Retrieves the asset corresponding to the given path, if it exists.

Value parameters

path

The path to the asset, relative to the assetPath.

Attributes

def getAsset(path: Iterable[String]): Option[Asset]

Retrieves the asset corresponding to the given path, if it exists.

Retrieves the asset corresponding to the given path, if it exists.

Value parameters

path

The path to the asset, relative to the assetPath. Given as a "/"-separated array of path segments.

Attributes

def getAsset(path: Path): Option[Asset]

Retrieves the asset corresponding to the given path, if it exists.

Retrieves the asset corresponding to the given path, if it exists.

Value parameters

path

The path to the asset, relative to the assetPath.

Attributes