Created
October 1, 2011 12:12
-
-
Save takezoe/1255951 to your computer and use it in GitHub Desktop.
The simple wrapper of java.util.Properties for Scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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