maguro 2005/03/22 16:24:01
Modified: modules/core/src/java/org/openejb/corba/compiler
AntCompiler.java
Log:
Real programmers have spaces in their directory names.
Revision Changes Path
1.6 +24 -14
openejb/modules/core/src/java/org/openejb/corba/compiler/AntCompiler.java
Index: AntCompiler.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/corba/compiler/AntCompiler.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AntCompiler.java 21 Mar 2005 23:22:36 -0000 1.5
+++ AntCompiler.java 22 Mar 2005 21:24:00 -0000 1.6
@@ -47,6 +47,8 @@
import java.io.File;
import java.net.URL;
import java.net.URLClassLoader;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.util.Iterator;
import java.util.Set;
@@ -84,12 +86,16 @@
addPathsFromClassLoader(project, classPath, utils, cl);
for (Iterator iter = classpaths.iterator(); iter.hasNext();) {
- URL url = (URL) iter.next();
- // We only can add file based paths.
- if( url.getProtocol().equals("file") ) {
- Path p = new Path(project);
- p.setLocation(utils.normalize(url.getPath()));
- classPath.addExisting(p);
+ try {
+ URL url = (URL) iter.next();
+ // We only can add file based paths.
+ if( url.getProtocol().equals("file") ) {
+ Path p = new Path(project);
+ p.setLocation(new File(new URI(url.toString())));
+ classPath.addExisting(p);
+ }
+ } catch (URISyntaxException e) {
+ // do nothing
}
}
javac.setClasspath(classPath);
@@ -108,12 +114,16 @@
URLClassLoader ucl = (URLClassLoader)cl;
URL[] urls = ucl.getURLs();
for (int i = 0; i < urls.length; i++) {
- URL url = urls[i];
- // We only can add file based paths.
- if( url.getProtocol().equals("file") ) {
- Path p = new Path(project);
- p.setLocation(utils.normalize(url.getPath()));
- classPath.addExisting(p);
+ try {
+ URL url = urls[i];
+ // We only can add file based paths.
+ if( url.getProtocol().equals("file") ) {
+ Path p = new Path(project);
+ p.setLocation(new File(new URI(url.toString())));
+ classPath.addExisting(p);
+ }
+ } catch (URISyntaxException e) {
+ // do nothing
}
}
}