19 lines
547 B
Java
19 lines
547 B
Java
package com.sunyard.util;
|
|
|
|
import java.io.FileInputStream;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStreamReader;
|
|
import java.util.Properties;
|
|
|
|
public class Configure {
|
|
public static String getKey(String key) throws IOException {
|
|
Properties p = new Properties();
|
|
InputStream in = new FileInputStream("./sunyard.properties");
|
|
InputStreamReader sr = new InputStreamReader(in, "UTF-8");
|
|
p.load(sr);
|
|
String value = p.getProperty(key).trim();
|
|
return value;
|
|
}
|
|
}
|