Added warning message if file is not found.

git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@418688 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Adrian T. Co 2006-07-03 05:45:42 +00:00
parent 6d9e5b5951
commit 20f08f48a8
1 changed files with 13 additions and 8 deletions

View File

@ -51,15 +51,20 @@ public abstract class ClassLoaderSPIConnectionFactory implements SPIConnectionFa
String dir = tokens.nextToken();
try {
File f = new File(dir);
log.info("Adding extension dir: " + f.getAbsolutePath());
urls.add(f.toURL());
if (!f.exists()) {
log.warn("Cannot find extension dir: " + f.getAbsolutePath());
} else {
log.info("Adding extension dir: " + f.getAbsolutePath());
File[] files = f.listFiles();
if( files!=null ) {
for (int j = 0; j < files.length; j++) {
if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar") ) {
log.info("Adding extension dir: " + files[j].getAbsolutePath());
urls.add(files[j].toURL());
urls.add(f.toURL());
File[] files = f.listFiles();
if( files!=null ) {
for (int j = 0; j < files.length; j++) {
if( files[j].getName().endsWith(".zip") || files[j].getName().endsWith(".jar") ) {
log.info("Adding extension dir: " + files[j].getAbsolutePath());
urls.add(files[j].toURL());
}
}
}
}