-
Notifications
You must be signed in to change notification settings - Fork 19
InputOutput
A configuration can be loaded from a file, by providing the filename as a string:
val config1 = Configuration.load("config1.conf")
or from scala.io.Source:
val config2 = Configuration.load(
Source fromURL "http://www.example.com/config/default"
)
The load methods take a second optional parameter of type ImportFormat. By default the
BlockFormat is used, see Formats for a list of all currently available formats.
A configuration can be directly loaded from the classpath as a resource:
val config3 = Configuration.loadResource("/config3.conf")
The loadResource methods take a second optional parameter of type ImportFormat. By default the
BlockFormat is used, see Formats for a list of all currently available formats.
A configuration can also be saved to a file, by providing the filename:
val config = Configuration.load( "before.conf" )
config.set("name","Gina").save( "after.conf" )
The save method take a second optional parameter of type ExportFormat. By default the
BlockFormat is used, see Formats for a list of all currently available formats.