From: <do...@hy...> - 2008-12-05 03:56:46
|
Author: dougm Date: 2008-12-04 19:56:40 -0800 (Thu, 04 Dec 2008) New Revision: 11970 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=11970 Modified: trunk/src/org/hyperic/util/PluginLoader.java Log: [HHQ-2684] add the directory itself when given Modified: trunk/src/org/hyperic/util/PluginLoader.java =================================================================== --- trunk/src/org/hyperic/util/PluginLoader.java 2008-12-04 18:52:52 UTC (rev 11969) +++ trunk/src/org/hyperic/util/PluginLoader.java 2008-12-05 03:56:40 UTC (rev 11970) @@ -256,7 +256,18 @@ if (isExpand || file.isDirectory()) { if (!isExpand) { + boolean addedDir = addedURLs.get(file) == Boolean.TRUE; logAddPath(file, true); + if (!addedDir) { + addedURLs.put(file, Boolean.TRUE); + //add the directory itself + //must end with '/' (see URLClassLoader) + try { + super.addURL(toURL(file.toString() + "/")); + } catch (Exception e) { + throw new PluginLoaderException(e.getMessage()); + } + } jars = file.list(); } |