mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-25 12:46:21 +10:00
[강운덕] [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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user