diff options
author | ashi | 2017-04-25 10:45:46 +0000 |
---|---|---|
committer | Martin Oberhuber | 2017-05-19 08:48:30 +0000 |
commit | aed730f815770789b3bd8546325917f26cfc609e (patch) | |
tree | d1e435d2b47780db9a03f3587b1eda4b0d5c3b9e | |
parent | 4070d696248f742b5ec74c84a2b52e920a99f164 (diff) | |
download | org.eclipse.tcf-aed730f815770789b3bd8546325917f26cfc609e.tar.gz org.eclipse.tcf-aed730f815770789b3bd8546325917f26cfc609e.tar.xz org.eclipse.tcf-aed730f815770789b3bd8546325917f26cfc609e.zip |
Bug 515665: [Target Explorer] Refresh after CANCELING download
After CANCELING a large download, the target folder is now still
refreshed. Also, in case the target folder is just a "linked"
resource or there are multiple aliases holding the target folder,
all those aliases are refreshed.
One loophole is NOT fixed with this: Downloading to folder
/base , havign the download fill /base/sub and refreshing
sub when that's an Eclipse project or linked resource.
In this case, "sub" is *not* refreshed but we can live with
this special case.
Change-Id: I1ea146eed33c28fe67d75b5205a8b4deb6690264
Signed-off-by: ashi <Aijun.Shi@windriver.com>
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/DownloadFilesHandler.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/DownloadFilesHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/DownloadFilesHandler.java index 5f4896494..47254d51f 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/DownloadFilesHandler.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.ui/src/org/eclipse/tcf/te/tcf/filesystem/ui/internal/handlers/DownloadFilesHandler.java @@ -22,7 +22,6 @@ import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; -import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.URIUtil; import org.eclipse.jface.viewers.IStructuredSelection; @@ -52,7 +51,7 @@ public class DownloadFilesHandler extends AbstractHandler { if (destination == null) return null; - File destinationFile = new File(destination); + final File destinationFile = new File(destination); saveFilterPath(destinationFile); IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelection(event); @@ -61,8 +60,7 @@ public class DownloadFilesHandler extends AbstractHandler { peer.operationDownload(nodes, destinationFile, new MoveCopyCallback()).runInUserJob(new Callback() { @Override protected void internalDone(Object caller, IStatus status) { - if (status.isOK()) { - IContainer container = ResourcesPlugin.getWorkspace().getRoot().getContainerForLocation(new Path(destination)); + for (IContainer container : ResourcesPlugin.getWorkspace().getRoot().findContainersForLocationURI(destinationFile.toURI())) { if (container != null) { try { container.refreshLocal(IResource.DEPTH_ONE, null); |