ConfigFilter support classpath

This commit is contained in:
wenshao
2012-11-10 16:18:25 +08:00
parent 7a201596cb
commit f6f11090ec
@@ -236,6 +236,9 @@ public class ConfigFilter extends FilterAdapter {
inStream = url.openStream();
xml = url.getPath().endsWith(".xml");
} else if (filePath.startsWith("classpath:")) {
String resourcePath = filePath.substring("classpath:".length());
inStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resourcePath);
} else {
File file = new File(filePath);
if (file.exists()) {