[강운덕] [LUCYSUS-1744] agent의 config 파일 수정.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-commons/trunk@718 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2012-09-27 07:40:01 +00:00
parent 04941dae64
commit ca5e75ac4c
2 changed files with 8 additions and 10 deletions
@@ -1,25 +1,24 @@
package com.profiler.common.util;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public class PropertyUtils {
public static Properties readProperties(String propertyName) {
public static Properties readProperties(String propertyName) throws IOException {
return readProperties(propertyName, PropertyUtils.class.getClassLoader());
}
public static Properties readProperties(String propertyName, ClassLoader cl) {
public static Properties readProperties(String propertyName, ClassLoader cl) throws IOException {
Properties properties = new Properties();
InputStream stream = cl.getResourceAsStream(propertyName);
if (stream == null) {
throw new RuntimeException(propertyName + " not found.");
throw new FileNotFoundException(propertyName + " not found.");
}
try {
properties.load(stream);
} catch (IOException e) {
throw new RuntimeException(propertyName + " load fail. Cause:" + e.getMessage(), e);
} finally {
try {
stream.close();