Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 364026 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/CopyAxisJarCommand.java (-6 / +17 lines)
Lines 60-65 Link Here
60
import org.eclipse.wst.common.environment.IEnvironment;
60
import org.eclipse.wst.common.environment.IEnvironment;
61
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
61
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
62
import org.eclipse.wst.ws.internal.common.BundleUtils;
62
import org.eclipse.wst.ws.internal.common.BundleUtils;
63
import org.osgi.framework.Version;
63
64
64
65
65
public class CopyAxisJarCommand extends AbstractDataModelOperation {
66
public class CopyAxisJarCommand extends AbstractDataModelOperation {
Lines 71-76 Link Here
71
	public static String JAVAX_XML_RPC_PLUGIN_ID = "javax.xml.rpc"; //$NON-NLS-1$
72
	public static String JAVAX_XML_RPC_PLUGIN_ID = "javax.xml.rpc"; //$NON-NLS-1$
72
	public static String JAVAX_XML_RPC_JAR = "jaxrpc.jar"; //$NON-NLS-1$
73
	public static String JAVAX_XML_RPC_JAR = "jaxrpc.jar"; //$NON-NLS-1$
73
	public static String JAVAX_XML_SOAP_PLUGIN_ID = "javax.xml.soap"; //$NON-NLS-1$
74
	public static String JAVAX_XML_SOAP_PLUGIN_ID = "javax.xml.soap"; //$NON-NLS-1$
75
	public static Version JAVAX_XML_SOAP_PLUGIN_VERSION = Version.parseVersion("1.2.0");
76
	private static Version JAVAX_XML_SOAP_PLUGIN_UPPER_VERSION = Version.parseVersion("1.3.0");
74
	public static String JAVAX_XML_SOAP_JAR = "saaj.jar"; //$NON-NLS-1$
77
	public static String JAVAX_XML_SOAP_JAR = "saaj.jar"; //$NON-NLS-1$
75
	public static String JAVAX_WSDL_PLUGIN_ID = "javax.wsdl"; //$NON-NLS-1$
78
	public static String JAVAX_WSDL_PLUGIN_ID = "javax.wsdl"; //$NON-NLS-1$
76
	public static String JAVAX_WSDL_JAR = "wsdl4j.jar"; //$NON-NLS-1$
79
	public static String JAVAX_WSDL_JAR = "wsdl4j.jar"; //$NON-NLS-1$
Lines 150-168 Link Here
150
		deleteObsoleteJars(webModulePath);
153
		deleteObsoleteJars(webModulePath);
151
154
152
155
153
		copyIFile(AXIS_RUNTIME_PLUGIN_ID, "lib/" + AXIS_JAR, webModulePath, "WEB-INF/lib/" + AXIS_JAR, status, env, monitor);
156
		copyIFile(AXIS_RUNTIME_PLUGIN_ID, null, null, "lib/" + AXIS_JAR, webModulePath, "WEB-INF/lib/" + AXIS_JAR, status, env, monitor);
154
		if (status.getSeverity() == Status.ERROR) {
157
		if (status.getSeverity() == Status.ERROR) {
155
			return;
158
			return;
156
		}
159
		}
157
		copyIFile(COMMON_DISCOVERY_PLUGIN_ID, "lib/" + COMMON_DISCOVERY_JAR, webModulePath, "WEB-INF/lib/" + COMMON_DISCOVERY_JAR, status, env, monitor);
160
		copyIFile(COMMON_DISCOVERY_PLUGIN_ID, null, null, "lib/" + COMMON_DISCOVERY_JAR, webModulePath, "WEB-INF/lib/" + COMMON_DISCOVERY_JAR, status, env, monitor);
158
		if (status.getSeverity() == Status.ERROR) {
161
		if (status.getSeverity() == Status.ERROR) {
159
			return;
162
			return;
160
		}
163
		}
161
		copyIFile(JAVAX_XML_RPC_PLUGIN_ID, "lib/" + JAVAX_XML_RPC_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_RPC_JAR, status, env, monitor);
164
		copyIFile(JAVAX_XML_RPC_PLUGIN_ID, null, null, "lib/" + JAVAX_XML_RPC_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_RPC_JAR, status, env, monitor);
162
		if (status.getSeverity() == Status.ERROR) {
165
		if (status.getSeverity() == Status.ERROR) {
163
			return;
166
			return;
164
		}
167
		}
165
		copyIFile(JAVAX_XML_SOAP_PLUGIN_ID, "lib/" + JAVAX_XML_SOAP_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_SOAP_JAR, status, env, monitor);
168
		copyIFile(JAVAX_XML_SOAP_PLUGIN_ID, JAVAX_XML_SOAP_PLUGIN_VERSION, JAVAX_XML_SOAP_PLUGIN_UPPER_VERSION, "lib/" + JAVAX_XML_SOAP_JAR, webModulePath, "WEB-INF/lib/" + JAVAX_XML_SOAP_JAR, status, env, monitor);
166
		if (status.getSeverity() == Status.ERROR) {
169
		if (status.getSeverity() == Status.ERROR) {
167
			return;
170
			return;
168
		}
171
		}
Lines 181-187 Link Here
181
	/**
184
	/**
182
	 * 
185
	 * 
183
	 */
186
	 */
184
	private void copyIFile(String pluginId, String source, IPath targetPath, String targetFile, IStatus status, IEnvironment env, IProgressMonitor monitor) {
187
	private void copyIFile(String pluginId, Version pluginVersion, Version upperVersion, String source, IPath targetPath, String targetFile, IStatus status, IEnvironment env, IProgressMonitor monitor) {
185
		IPath target = targetPath.append(new Path(targetFile));
188
		IPath target = targetPath.append(new Path(targetFile));
186
		ProgressUtils.report(monitor, ConsumptionMessages.PROGRESS_INFO_COPYING_FILE);
189
		ProgressUtils.report(monitor, ConsumptionMessages.PROGRESS_INFO_COPYING_FILE);
187
190
Lines 190-196 Link Here
190
			context.setOverwriteFilesEnabled(true);
193
			context.setOverwriteFilesEnabled(true);
191
			context.setCreateFoldersEnabled(true);
194
			context.setCreateFoldersEnabled(true);
192
			context.setCheckoutFilesEnabled(true);
195
			context.setCheckoutFilesEnabled(true);
193
			URL sourceURL = BundleUtils.getURLFromBundle(pluginId, source);
196
197
			URL sourceURL = null;
198
			if (pluginVersion != null) {
199
				sourceURL = BundleUtils.getURLFromBundle(pluginId, pluginVersion, upperVersion, source);
200
			}
201
			else {
202
				sourceURL = BundleUtils.getURLFromBundle(pluginId, source);
203
			}
204
194
			IFile resource = ResourceUtils.getWorkspaceRoot().getFile(target);
205
			IFile resource = ResourceUtils.getWorkspaceRoot().getFile(target);
195
			if (!resource.exists()) {
206
			if (!resource.exists()) {
196
				IFile file = FileResourceUtils.createFile(context, target, sourceURL.openStream(), monitor, env.getStatusHandler());
207
				IFile file = FileResourceUtils.createFile(context, target, sourceURL.openStream(), monitor, env.getStatusHandler());
(-)src/org/eclipse/wst/ws/internal/common/BundleUtils.java (-1 / +23 lines)
Lines 30-42 Link Here
30
{
30
{
31
	static public URL getURLFromBundle( String bundleId, String path ) throws MalformedURLException
31
	static public URL getURLFromBundle( String bundleId, String path ) throws MalformedURLException
32
	{
32
	{
33
		Bundle      bundle     = Platform.getBundle( bundleId );
33
		Bundle      bundle     = Platform.getBundle(bundleId);
34
		URL         installURL = bundle.getEntry("/");
34
		URL         installURL = bundle.getEntry("/");
35
		URL         fileURL    = new URL(installURL, path );
35
		URL         fileURL    = new URL(installURL, path );
36
36
37
		return fileURL;
37
		return fileURL;
38
	}
38
	}
39
39
40
	static public URL getURLFromBundle( String bundleId, Version bundleVersion, Version upperVersion, String path ) throws MalformedURLException
41
	{
42
		Bundle      bundle     = getBundleWithinVersionRange(bundleId, bundleVersion, upperVersion);
43
		URL         installURL = bundle.getEntry("/");
44
		URL         fileURL    = new URL(installURL, path );
45
46
		return fileURL;
47
	}
48
49
	private static Bundle getBundleWithinVersionRange(String bundleId,
50
			Version bundleVersion, Version upperVersion) {
51
		Bundle[] bundles = Platform.getBundles(bundleId, bundleVersion.toString());
52
		for(Bundle bundle : bundles) {
53
			Version aVersion = bundle.getVersion();
54
			if (aVersion.compareTo(bundleVersion) >= 0 && aVersion.compareTo(upperVersion) < 0) {
55
				return bundle;
56
			}
57
		}
58
		
59
		return null;
60
	}
61
40
	/**
62
	/**
41
	 * @param bundleId
63
	 * @param bundleId
42
	 * @return Returns the path for the Jarred plugin.  Returns null if path not found.
64
	 * @return Returns the path for the Jarred plugin.  Returns null if path not found.

Return to bug 364026