@Test public void files() throws IOException { assertFalse(PropertySources.fromFile("nonexistent.properties").get("test2").isPresent()); File externalProperties = File.createTempFile("test", ".properties"); try { Files.write("test4=value4\n", externalProperties, Charsets.UTF_8); assertEquals("value", PropertySources.fromFile("test.properties").get("test").get()); assertFalse(PropertySources.fromFile("test.properties").get("test2").isPresent()); assertEquals("value3", PropertySources.fromFile("test.properties").orFile("test2.properties").get("test3").get()); assertFalse(PropertySources.fromFile("test.properties").orFile("test2.properties").get("test4").isPresent()); assertEquals("value", PropertySources.fromFile("test.properties").getRequired("test").asString()); assertEquals("value3", PropertySources.fromFile("test.properties").orFile("test2.properties").getRequired("test3").asString()); assertEquals("value4", PropertySources.fromFile(externalProperties.getPath()).orFile("test2.properties").getRequired("test4").asString()); } finally { externalProperties.delete(); } }
public static PropertySourceChain fromFile(String path) { return fromFile(path, null); }
PropertySources { public static PropertySourceChain fromFile(String path) { return fromFile(path, null); } }
PropertySources { public static PropertySourceChain fromFile(String path) { return fromFile(path, null); }  }
PropertySources { public static PropertySourceChain fromFile(String path) { return fromFile(path, null); }  static PropertySourceChain from(PropertySource source); static PropertySourceChain from(PropertySource source, Func1<String, String> transformer); static PropertySourceChain fromConstantsClass(Class<T> constantsClass); static PropertySourceChain fromConstantsClass(Class<T> constantsClass, Func1<String, String> transformer); static PropertySourceChain fromComputed(Func1<String, String> computation); static PropertySourceChain fromComputed(Func1<String, String> computation, Func1<String, String> transformer); static PropertySourceChain fromEnvironment(); static PropertySourceChain fromEnvironment(Func1<String, String> transformer); static PropertySourceChain fromFile(String path); static PropertySourceChain fromFile(String path, Func1<String, String> transformer); static PropertySourceChain fromImmediate(Action1<ImmediatePropertySource> initializer); static PropertySourceChain fromImmediate(
            Action1<ImmediatePropertySource> initializer,
            Func1<String, String> transformer); static PropertySourceChain fromSystem(); static PropertySourceChain fromSystem(Func1<String, String> transformer); }
PropertySources { public static PropertySourceChain fromFile(String path) { return fromFile(path, null); }  static PropertySourceChain from(PropertySource source); static PropertySourceChain from(PropertySource source, Func1<String, String> transformer); static PropertySourceChain fromConstantsClass(Class<T> constantsClass); static PropertySourceChain fromConstantsClass(Class<T> constantsClass, Func1<String, String> transformer); static PropertySourceChain fromComputed(Func1<String, String> computation); static PropertySourceChain fromComputed(Func1<String, String> computation, Func1<String, String> transformer); static PropertySourceChain fromEnvironment(); static PropertySourceChain fromEnvironment(Func1<String, String> transformer); static PropertySourceChain fromFile(String path); static PropertySourceChain fromFile(String path, Func1<String, String> transformer); static PropertySourceChain fromImmediate(Action1<ImmediatePropertySource> initializer); static PropertySourceChain fromImmediate(
            Action1<ImmediatePropertySource> initializer,
            Func1<String, String> transformer); static PropertySourceChain fromSystem(); static PropertySourceChain fromSystem(Func1<String, String> transformer);  }