From 14dde61832797110bc2d5a8d7af4fa9d9a3390df Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Tue, 11 Nov 2014 22:42:01 +0100 Subject: [PATCH] Reorder methods in BitsquareEnvironment for clarity --- .../bitsquare/app/BitsquareEnvironment.java | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/io/bitsquare/app/BitsquareEnvironment.java b/src/main/java/io/bitsquare/app/BitsquareEnvironment.java index a826c8c48a..57a5ade700 100644 --- a/src/main/java/io/bitsquare/app/BitsquareEnvironment.java +++ b/src/main/java/io/bitsquare/app/BitsquareEnvironment.java @@ -92,6 +92,21 @@ public class BitsquareEnvironment extends StandardEnvironment { } + PropertySource filesystemProperties() throws Exception { + String location = String.format("file:%s/bitsquare.properties", appDataDir); + Resource resource = resourceLoader.getResource(location); + + if (!resource.exists()) + return new PropertySource.StubPropertySource(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME); + + return new ResourcePropertySource(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME, resource); + } + + PropertySource classpathProperties() throws Exception { + Resource resource = resourceLoader.getResource("classpath:bitsquare.properties"); + return new ResourcePropertySource(BITSQUARE_CLASSPATH_PROPERTY_SOURCE_NAME, resource); + } + PropertySource defaultProperties() throws Exception { return new PropertiesPropertySource(BITSQUARE_DEFAULT_PROPERTY_SOURCE_NAME, new Properties() {{ setProperty(APP_DATA_DIR_KEY, appDataDir); @@ -110,21 +125,6 @@ public class BitsquareEnvironment extends StandardEnvironment { }}); } - PropertySource classpathProperties() throws Exception { - Resource resource = resourceLoader.getResource("classpath:bitsquare.properties"); - return new ResourcePropertySource(BITSQUARE_CLASSPATH_PROPERTY_SOURCE_NAME, resource); - } - - PropertySource filesystemProperties() throws Exception { - String location = String.format("file:%s/bitsquare.properties", appDataDir); - Resource resource = resourceLoader.getResource(location); - - if (!resource.exists()) - return new PropertySource.StubPropertySource(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME); - - return new ResourcePropertySource(BITSQUARE_FILESYSTEM_PROPERTY_SOURCE_NAME, resource); - } - private static String defaultUserDataDir() { String os = System.getProperty("os.name").toLowerCase();