refactor loadClass

This commit is contained in:
wenshao
2012-07-19 10:59:54 +08:00
parent 3ee01ce1a2
commit 92b106565b
8 changed files with 37 additions and 256 deletions
@@ -16,6 +16,21 @@ public class IOUtils {
InputStreamReader reader = new InputStreamReader(in);
return read(reader);
}
public static String readFromResource(String resource) throws IOException {
InputStream in = null;
try {
in = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
if (in == null) {
return null;
}
String text = IOUtils.read(in);
return text;
} finally {
JdbcUtils.close(in);
}
}
public static String read(Reader reader) {
try {