Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base: aa347be63a
...
compare: 993639f94d
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Showing with 5 additions and 11 deletions.
  1. +5 −11 app/plugin/PropertiesFileConfigurationPlugin.java
View
16 app/plugin/PropertiesFileConfigurationPlugin.java
@@ -7,23 +7,17 @@
import play.Logger;
import play.Play;
import play.PlayPlugin;
+import play.libs.IO;
public class PropertiesFileConfigurationPlugin extends PlayPlugin {
public void onApplicationStart() {
String propertiesFilename = Play.configuration.getProperty("externalConfig.fileName", "/" + Play.id + ".properties");
-
Logger.info("Loading configuration from " + propertiesFilename);
-
- try {
- Properties properties = new Properties();
- properties.load(this.getClass().getResourceAsStream(propertiesFilename));
-
- for (Entry<Object, Object> entry : properties.entrySet()) {
- Play.configuration.setProperty((String) entry.getKey(),(String) entry.getValue());
- }
- } catch (IOException e) {
- throw new RuntimeException("Unable to read .properties from classpath");
+ Properties properties = IO.readUtf8Properties(this.getClass().getResourceAsStream(propertiesFilename));
+
+ for (Entry<Object, Object> entry : properties.entrySet()) {
+ Play.configuration.setProperty((String) entry.getKey(),(String) entry.getValue());
}
}
}

No commit comments for this range

Something went wrong with that request. Please try again.