Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkchan2006-12-21 18:09:29 +0000
committerkchan2006-12-21 18:09:29 +0000
commit995db34657fd4578e1c15b1c67ff398d2e6047d6 (patch)
treeabaa4774c382bc5e54d8890db4036f6d37ee0ee8
parent98c171fb328893f530f22c66109423ac6d60f7ae (diff)
downloadwebtools.webservices-995db34657fd4578e1c15b1c67ff398d2e6047d6.tar.gz
webtools.webservices-995db34657fd4578e1c15b1c67ff398d2e6047d6.tar.xz
webtools.webservices-995db34657fd4578e1c15b1c67ff398d2e6047d6.zip
[168787] Check publish directory before copying Axis server-config.wsdd.
-rw-r--r--bundles/org.eclipse.jst.ws.axis.creation.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java49
2 files changed, 30 insertions, 21 deletions
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.axis.creation.ui/META-INF/MANIFEST.MF
index 317344934..029738630 100644
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.axis.creation.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.axis.creation.ui; singleton:=true
-Bundle-Version: 1.0.102.qualifier
+Bundle-Version: 1.0.103.qualifier
Bundle-Activator: org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java
index dcc43507b..f97e54b62 100644
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java
+++ b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/CopyDeploymentFileCommand.java
@@ -10,10 +10,12 @@
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20060524 130755 kathy@ca.ibm.com - Kathy Chan
+ * 20061221 168787 kathy@ca.ibm.com - Kathy Chan
*******************************************************************************/
package org.eclipse.jst.ws.internal.axis.creation.ui.command;
+import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
@@ -27,6 +29,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.jst.ws.internal.axis.consumption.core.AxisConsumptionCoreMessages;
import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.eclipse.jst.ws.internal.common.ResourceUtils;
import org.eclipse.jst.ws.internal.plugin.WebServicePlugin;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.command.internal.env.common.FileResourceUtils;
@@ -97,31 +100,37 @@ public class CopyDeploymentFileCommand extends AbstractDataModelOperation
serverModules = new IModule [] {EARProjectModule, projectModule};
}
IPath publishDirPath = publishHelper.getPublishDirectory(serverModules);
+
if (publishDirPath != null) {
- IPath path = new Path( WEB_INF ).append( SERVER_CONFIG );
- IPath serverConfigPath = publishDirPath.append(path);
- if (serverConfigPath != null) {
- IVirtualFolder rootFolder = component.getRootFolder();
- if (rootFolder != null) {
- IVirtualFile newLocation = rootFolder.getFile(path);
- IPath targetPath = newLocation.getWorkspaceRelativePath();
-
- if (targetPath != null) {
- finStream = new FileInputStream(serverConfigPath.toString());
- if (finStream != null) {
- IStatusHandler statusHandler = environment.getStatusHandler();
- ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
- FileResourceUtils.createFile(context,
- targetPath,
- finStream,
- monitor,
- statusHandler);
- finStream.close();
+ IVirtualFolder rootFolder = component.getRootFolder();
+ IPath rootFolderPath = ResourceUtils.getWorkspaceRoot().getFile(rootFolder.getWorkspaceRelativePath()).getLocation();
+ if (rootFolderPath != null) {
+ File rootFolderFile = rootFolderPath.toFile();
+ File publishDirFile = publishDirPath.toFile();
+ if (!rootFolderFile.equals(publishDirFile)) {
+ // copy the server-config.wsdd if the publish directory is not in the same as the project root folder
+ IPath path = new Path( WEB_INF ).append( SERVER_CONFIG );
+ IPath serverConfigPath = publishDirPath.append(path);
+ if (serverConfigPath != null) {
+ IVirtualFile newLocation = rootFolder.getFile(path);
+ IPath targetPath = newLocation.getWorkspaceRelativePath();
+ if (targetPath != null) {
+ finStream = new FileInputStream(serverConfigPath.toString());
+ if (finStream != null) {
+ IStatusHandler statusHandler = environment.getStatusHandler();
+ ResourceContext context = WebServicePlugin.getInstance().getResourceContext();
+ FileResourceUtils.createFile(context,
+ targetPath,
+ finStream,
+ monitor,
+ statusHandler);
+ finStream.close();
+ }
}
}
}
}
- }
+ }
}
}
}

Back to the top