01: package test.infra;
02:
03: import java.io.IOException;
04: import java.util.Properties;
05:
06: /**
07: * Gets password from a property file.
08: *
09: * @author Kohsuke Kawaguchi
10: */
11: public class PasswordStore {
12: public static final String get(String key) {
13: try {
14: Properties props = new Properties();
15: props.load(PasswordStore.class
16: .getResourceAsStream("/passwords.properties"));
17: return (String) props.get(key);
18: } catch (IOException e) {
19: throw new Error(e);
20: }
21: }
22: }
|