Java axis 配置host_Java AxisProperties类代码示例

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;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值