diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java index 9123596c287..2290037f0ad 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java @@ -37,6 +37,7 @@ * David McKnight (IBM) - [249544] Save conflict dialog appears when saving files in the editor * David McKnight (IBM) - [267247] Wrong encoding * David McKnight (IBM) - [272772] Exception handling in SystemEditableRemoteFile + * David McKnight (IBM) - [284420] nullprogressmonitor is needed *******************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -723,7 +724,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP /** * Upload the file */ - private void upload() throws Exception + private void upload(IProgressMonitor monitor) throws Exception { if (!subsystem.isConnected()) @@ -738,13 +739,13 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP IFile file = getLocalResource(); String srcEncoding = RemoteFileUtility.getSourceEncoding(file); - subsystem.upload(localPath, remoteFile, srcEncoding, null); + subsystem.upload(localPath, remoteFile, srcEncoding, monitor); // update timestamp SystemIFileProperties properties = new SystemIFileProperties(file); //DKM- saveAS fix - remoteFile = subsystem.getRemoteFileObject(remoteFile.getAbsolutePath(), new NullProgressMonitor()); + remoteFile = subsystem.getRemoteFileObject(remoteFile.getAbsolutePath(), monitor); properties.setRemoteFileTimeStamp(remoteFile.getLastModified()); } @@ -1810,7 +1811,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP if (resource.getLocation().equals(getLocalResource().getLocation())) { - upload(); + upload(new NullProgressMonitor()); } } catch (Exception e) @@ -1924,7 +1925,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP try { this.setLocalResourceProperties(); - this.upload(); + this.upload(progressMonitor); } catch (SystemMessageException e) { SystemMessageDialog dialog = new SystemMessageDialog(SystemBasePlugin.getActiveWorkbenchShell(), e.getSystemMessage()); dialog.open(); diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java index 8a4886a8fd9..e0036e1604b 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java @@ -59,6 +59,8 @@ * David McKnight (IBM) - [279014] [dstore][encoding] text file corruption can occur when downloading from UTF8 to cp1252 * David McKnight (IBM) - [279695] [dstore] Connection file encoding is not refreshed from the host * David McKnight (IBM) - [281712] [dstore] Warning message is needed when disk is full + * David McKnight (IBM) - [284056] Sychronize Cache causes the UI to hang with no way out + * David McKnight (IBM) - [284420] nullprogressmonitor is needed *******************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -716,7 +718,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer resultStr = result.getSource(); - if (resultStr.equals("failed") || monitor.isCanceled()){ //$NON-NLS-1$ + if (resultStr.equals("failed") || (monitor != null && monitor.isCanceled())){ //$NON-NLS-1$ String msgTxt = NLS.bind(ServiceResources.FILEMSG_COPY_FILE_FAILED, remotePath); SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID, IStatus.ERROR, msgTxt); throw new SystemMessageException(msg); @@ -1041,6 +1043,9 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer //InterruptedException is used to report user cancellation, so no need to log //This should be reviewed (use OperationCanceledException) with bug #190750 } + if (monitor.isCanceled()){ + return; + } } } catch (Exception e)