Skip to content

Instantly share code, notes, and snippets.

@takezoe
Created October 1, 2011 12:12
Show Gist options
  • Save takezoe/1255951 to your computer and use it in GitHub Desktop.
Save takezoe/1255951 to your computer and use it in GitHub Desktop.
The simple wrapper of java.util.Properties for Scala
class Properties(path: String) {
private val props: java.util.Properties = new java.util.Properties()
props.load(Thread.currentThread.getContextClassLoader.getResourceAsStream(path))
def apply(key: String): Option[String] = Option(props.getProperty(key))
}
object Properties {
def apply(path: String) = new Properties(path)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment