Commit 6598cb21 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

1)Updating build to allow for own development classpath.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1474 b35dd754-fafc-0310-a699-88a17e54d16e
parent 064dc050
......@@ -24,7 +24,7 @@ import java.util.List;
* ClassLoader for plugins. It searches the plugin directory for classes
* and JAR files, then constructs a class loader for the resources found.
* Resources are loaded as follows:<ul>
*
* <p/>
* <li>Any JAR files in the <tt>lib</tt> will be added to the classpath.
* <li>Any files in the classes directory will be added to the classpath.
* </ul>
......@@ -34,6 +34,8 @@ import java.util.List;
class PluginClassLoader {
private URLClassLoader classLoader;
private final List list = new ArrayList();
/**
* Constructs a plugin loader for the given plugin directory.
......@@ -45,7 +47,6 @@ class PluginClassLoader {
* properly converted to a URL.
*/
public PluginClassLoader(File pluginDir) throws MalformedURLException, SecurityException {
final List list = new ArrayList();
File classesDir = new File(pluginDir, "classes");
if (classesDir.exists()) {
list.add(classesDir.toURL());
......@@ -63,6 +64,13 @@ class PluginClassLoader {
}
}
}
}
public void addURL(URL url) {
list.add(url);
}
public void initialize(){
Iterator urls = list.iterator();
URL[] urlArray = new URL[list.size()];
for (int i = 0; urls.hasNext(); i++) {
......@@ -82,8 +90,7 @@ class PluginClassLoader {
* @throws SecurityException if the custom class loader not allowed.
*/
public Class loadClass(String name) throws ClassNotFoundException, IllegalAccessException,
InstantiationException, SecurityException
{
InstantiationException, SecurityException {
return classLoader.loadClass(name);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment