import org.apache.axis.AxisProperties; //导入依赖的package包/类
private StringBuilder getDefaultClasspath() throws IOException {
StringBuilder classpath = new StringBuilder();
ClassLoader cl = Thread.currentThread().getContextClassLoader();
while (cl != null) {
if (cl instanceof URLClassLoader) {
URL[] urls = ((URLClassLoader) cl).getURLs();
for (int i = 0; (urls != null) && i < urls.length; i++)
addPathToBuffer(urls[i], classpath);
}
cl = cl.getParent();
}
// Add the BD JARs to the java compiler classpath
String ps = System.getProperty("path.separator");
String fs = System.getProperty("file.separator");
String dir = null;
String libDir = null;
String bootClassPath = AxisProperties.getProperty("sun.boot.class.path");
// The JARs are in the WEB-INF lib folder.
dir = cfWebServices.getDocRootDir();
if (dir != null && !dir.endsWith(fs))
dir += fs;
dir = dir + "WEB-INF" + fs;
libDir = dir + "lib" + fs;
String altLibDir= cfEngine.getAltLibPath();
if (!bootClassPath.contains("webservices.jar") && classpath.indexOf("webservices.jar") < 0) {
classpath.append( ps );
classpath.append( getJarPath(libDir, altLibDir, "webservices.jar") );
}
if (!bootClassPath.contains("wsdl4j.jar") && classpath.indexOf("wsdl4j.jar") < 0) {
classpath.append( ps );
classpath.append( getJarPath(libDir, altLibDir, "wsdl4j.jar") );
}
if (!bootClassPath.contains("saaj.jar") && classpath.indexOf("saaj.jar") < 0) {
classpath.append( ps );
classpath.append( getJarPath(libDir, altLibDir, "saaj.jar") );
}
if (!bootClassPath.contains("jaxrpc.jar") && classpath.indexOf("jaxrpc.jar") < 0) {
classpath.append( ps );
classpath.append( getJarPath(libDir, altLibDir, "jaxrpc.jar") );
}
classpath.append(ps + dir + "classes");
// Add the J2EE specific jars (not required as classes, may be in the classes dir)
classpath.append( ps );
classpath.append( getJarPath(libDir, altLibDir, "OpenBlueDragon.jar") );
// boot classpath isn't found in above search
if (bootClassPath != null)
classpath.append(ps + bootClassPath);
return classpath;
}