public class PropertyUtils {
private static Properties prop = new Properties();
static {
try {
String path = System.getProperty("user.dir");
prop.load(new FileInputStream(new File(path+"/config/configs.properties")));
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
}
}
public static String getProperty(String name) {
return prop.getProperty(name);
}
public static void main(String[] args) {
System.out.println(PropertyUtils.getProperty("env"));
}
@Autowired
private Environment environment;
environment.getProperty("node.mem.rate")
@Value("${application.midware.distribute.session.timeout}")