ResourceLoader

laika.io.config.ResourceLoader$

Internal utility for loading text resources from the file system, the classpath or via its URL.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Concise view

Value members

Concrete methods

def loadClasspathResource[F[_] : Async](resource: String): F[Option[Either[ConfigResourceError, String]]]

Load the specified classpath resource.

Load the specified classpath resource.

The resource name is interpreted as absolute and should not start with a leading /.

If the resource does not exist the result will be None. If it does exist, but fails to load or parse correctly the result will be Some(Left(...)), successfully parsed resources will be returned as Some(Right(...)).

Attributes

def loadFile[F[_] : Async](file: String): F[Option[Either[ConfigResourceError, String]]]

Load the file with the specified name.

Load the file with the specified name.

If the file does not exist the result will be None. If it does exist, but fails to load or parse correctly the result will be Some(Left(...)), successfully parsed resources will be returned as Some(Right(...)).

Attributes

def loadFile[F[_] : Async](file: FilePath): F[Option[Either[ConfigResourceError, String]]]

Load the specified file (which may be a file on the file system or a classpath resource).

Load the specified file (which may be a file on the file system or a classpath resource).

If the file does not exist the result will be None. If it does exist, but fails to load or parse correctly the result will be Some(Left(...)), successfully parsed resources will be returned as Some(Right(...)).

Attributes

def loadUrl[F[_] : Async](url: URL): F[Option[Either[ConfigResourceError, String]]]

Load the configuration from the specified URL.

Load the configuration from the specified URL.

If the resource does not exist (404 response) the result will be None. If it does exist, but fails to load or parse correctly the result will be Some(Left(...)), successfully parsed resources will be returned as Some(Right(...)).

Attributes