### Eclipse Workspace Patch 1.0 #P org.jboss.ide.eclipse.as.core Index: jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java =================================================================== --- jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java (revision 27839) +++ jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java (working copy) @@ -196,8 +196,7 @@ File temp = deployRoot.toFile().createTempFile(module.getName(), ".tmp", deployRoot.toFile()); //$NON-NLS-1$ IPath tempFile = new Path(temp.getAbsolutePath()); list.addAll(Arrays.asList(PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile))); - String root = (deployPath.getDevice() == null ? "" : deployPath.getDevice()) + "/"; //$NON-NLS-1$//$NON-NLS-2$ - IPublishCopyCallbackHandler handler = getCallbackHandler(new Path(root)); + IPublishCopyCallbackHandler handler = getCallbackHandler(getRootPath(deployPath)); String parentFolder = deployPath.removeLastSegments(1).toString(); handler.makeDirectoryIfRequired(new Path(parentFolder), getSubMon(monitor, 200)); ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile); @@ -212,6 +211,10 @@ return createMultiStatus(list, module); return Status.OK_STATUS; } + private Path getRootPath(IPath deployPath) { + String root = (deployPath.getDevice() == null ? "" : deployPath.getDevice()) + "/"; //$NON-NLS-1$//$NON-NLS-2$ + return new Path(root); + } protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException { monitor.beginTask("Incremental Publish: " + moduleTree[moduleTree.length-1].getName(), 100); //$NON-NLS-1$ @@ -234,7 +237,7 @@ File temp = File.createTempFile(module.getName(), ".tmp", localDeployRoot.toFile()); //$NON-NLS-1$ IPath tempFile = new Path(temp.getAbsolutePath()); PublishUtil.packModuleIntoJar(moduleTree[moduleTree.length-1], tempFile); - handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$ + handler = getCallbackHandler(getRootPath(deployPath)); String parentFolder = deployPath.removeLastSegments(1).toString(); handler.makeDirectoryIfRequired(new Path(parentFolder), getSubMon(monitor, 50)); ModuleFile mf = new ModuleFile(tempFile.toFile(), tempFile.lastSegment(), tempFile); @@ -279,7 +282,7 @@ IModuleResource[] members = PublishUtil.getResources(moduleTree); File source = PublishUtil.getFile(members[0]); if( source != null ) { - IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$ + IPublishCopyCallbackHandler handler = getCallbackHandler(getRootPath(destinationPath)); IPath localFilePath = new Path(source.getAbsolutePath()); ModuleFile mf = new ModuleFile(localFilePath.toFile(), localFilePath.lastSegment(), localFilePath); handler.copyFile(mf, destinationPath, new NullProgressMonitor()); @@ -301,7 +304,7 @@ IProgressMonitor monitor) throws CoreException { monitor.beginTask("Removing Module: " + module[module.length-1].getName(), 100); //$NON-NLS-1$ IPath remotePath = getDeployPath(module, server); - IPublishCopyCallbackHandler handler = getCallbackHandler(new Path("/")); //$NON-NLS-1$ + IPublishCopyCallbackHandler handler = getCallbackHandler(getRootPath(remotePath)); handler.deleteResource(remotePath, getSubMon(monitor, 100)); monitor.done(); return Status.OK_STATUS;