public static StringgetDirPath() {
Resource resource =null;
Properties props =null;
String driverClass =null;
try {
resource =new ClassPathResource("/application.properties");
props = PropertiesLoaderUtils.loadProperties(resource);
driverClass = (String) props.get("socketPort");
}catch (IOException e) {
e.printStackTrace();
}
return driverClass;
}
网友评论