Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Torregrosa2015-11-20 07:40:14 -0500
committerPablo Torregrosa Paez2015-11-20 08:16:03 -0500
commitbc02ea7e9462fcc87467d70d90076090664e5126 (patch)
tree38677b9979af84170f19d6542083681fa6d5625e /target_explorer
parent2424f97a39a1defbb2b7072f530a6f72c9cc3c48 (diff)
downloadorg.eclipse.tcf-bc02ea7e9462fcc87467d70d90076090664e5126.tar.gz
org.eclipse.tcf-bc02ea7e9462fcc87467d70d90076090664e5126.tar.xz
org.eclipse.tcf-bc02ea7e9462fcc87467d70d90076090664e5126.zip
Target Explorer: Fixed error when refreshing FS and connection closed
Change-Id: I4b00b263e56bf7672cbbf61b6f8d8682126f8123 Signed-off-by: Pablo Torregrosa <pablo.torregrosa@windriver.com>
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpRefresh.java37
1 files changed, 20 insertions, 17 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpRefresh.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpRefresh.java
index b9915b375..ec3e251b0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpRefresh.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.filesystem.core/src/org/eclipse/tcf/te/tcf/filesystem/core/internal/operations/OpRefresh.java
@@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.osgi.util.NLS;
+import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IFileSystem;
@@ -159,23 +160,25 @@ public class OpRefresh extends AbstractOperation {
fs.roots(new DoneRoots() {
@Override
public void doneRoots(IToken token, FileSystemException error, DirEntry[] entries) {
- if (error != null) {
- result.setError(format(Messages.OpRefresh_errorGetRoots, node.getRuntimeModel().getName()), error);
- } else if (!result.checkCancelled()) {
- Delegate delegate = node.getRuntimeModel().getDelegate();
- List<FSTreeNode> nodes = new ArrayList<FSTreeNode>(entries.length);
- for (DirEntry entry : entries) {
- if (delegate.filterRoot(entry)) {
- nodes.add(new FSTreeNode(node, entry.filename, true, entry.attrs));
- }
- }
- node.setContent(nodes.toArray(new FSTreeNode[nodes.size()]), false);
- for (FSTreeNode node : node.getChildren()) {
- if (fRecursive || node.isFile()) {
- fWork.addFirst(node);
- }
- }
- result.setDone(null);
+ if (node.getRuntimeModel().getChannel() == null || node.getRuntimeModel().getChannel().getState() != IChannel.STATE_CLOSED) {
+ if (error != null) {
+ result.setError(format(Messages.OpRefresh_errorGetRoots, node.getRuntimeModel().getName()), error);
+ } else if (!result.checkCancelled()) {
+ Delegate delegate = node.getRuntimeModel().getDelegate();
+ List<FSTreeNode> nodes = new ArrayList<FSTreeNode>(entries.length);
+ for (DirEntry entry : entries) {
+ if (delegate.filterRoot(entry)) {
+ nodes.add(new FSTreeNode(node, entry.filename, true, entry.attrs));
+ }
+ }
+ node.setContent(nodes.toArray(new FSTreeNode[nodes.size()]), false);
+ for (FSTreeNode node : node.getChildren()) {
+ if (fRecursive || node.isFile()) {
+ fWork.addFirst(node);
+ }
+ }
+ result.setDone(null);
+ }
}
}
});

Back to the top