1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-28 10:43:31 +02:00

[323299] [files] remote file view adapter needs to use the latest version of IRemoteFile

This commit is contained in:
David McKnight 2010-08-23 19:06:47 +00:00
parent 0fdcdaf37d
commit ac14404a1f

View file

@ -67,6 +67,7 @@
* David McKnight (IBM) - [309813] RSE permits opening of file after access removed * David McKnight (IBM) - [309813] RSE permits opening of file after access removed
* David McKnight (IBM) - [308221] Bidi3.6: Improper display of date in Properties and Table Views * David McKnight (IBM) - [308221] Bidi3.6: Improper display of date in Properties and Table Views
* David McKnight (IBM) - [317541] Show blank as the last modified for a file with no last modified * David McKnight (IBM) - [317541] Show blank as the last modified for a file with no last modified
* David McKnight (IBM) - [323299] [files] remote file view adapter needs to use the latest version of IRemoteFile
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.files.ui.view; package org.eclipse.rse.internal.files.ui.view;
@ -168,6 +169,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileEmpty; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileEmpty;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileRoot; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileRoot;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResultsContentsType; import org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResultsContentsType;
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName; import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
@ -648,6 +650,14 @@ public class SystemViewRemoteFileAdapter
} }
IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem(); IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem();
// make sure we have the lastest cached version otherwise could be working with a bad file that never got marked as stale
if (ss instanceof RemoteFileSubSystem){
IRemoteFile cachedFile = ((RemoteFileSubSystem)ss).getCachedRemoteFile(file.getAbsolutePath());
if (cachedFile != null){
file = cachedFile;
}
}
/* /*
RemoteFileFilterString orgRffs = file.getFilterString(); RemoteFileFilterString orgRffs = file.getFilterString();
@ -746,65 +756,67 @@ public class SystemViewRemoteFileAdapter
} }
} }
boolean hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter); synchronized (file){
boolean hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter);
if (hasChildren && !file.isStale()) if (hasChildren && !file.isStale())
{
children = file.getContents(RemoteChildrenContentsType.getInstance(), filter);
children = filterChildren(children);
}
else
{
try
{ {
if (monitor != null) children = file.getContents(RemoteChildrenContentsType.getInstance(), filter);
{ children = filterChildren(children);
}
children = ss.resolveFilterString(file, filter, monitor); else
} {
else try
{
children = ss.resolveFilterString(file, filter, new NullProgressMonitor());
}
if ((children == null) || (children.length == 0))
{ {
children = EMPTY_LIST; if (monitor != null)
} {
else
{ children = ss.resolveFilterString(file, filter, monitor);
if (children.length == 1 && children[0] instanceof SystemMessageObject) }
else
{
children = ss.resolveFilterString(file, filter, new NullProgressMonitor());
}
if ((children == null) || (children.length == 0))
{ {
// don't filter children so that the message gets propagated children = EMPTY_LIST;
} }
else else
{ {
children = filterChildren(children); if (children.length == 1 && children[0] instanceof SystemMessageObject)
{
// don't filter children so that the message gets propagated
}
else
{
children = filterChildren(children);
}
} }
} }
catch (InterruptedException exc)
{
children = new SystemMessageObject[1];
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
ICommonMessageIds.MSG_EXPAND_CANCELLED,
IStatus.CANCEL, CommonMessages.MSG_EXPAND_CANCELLED);
children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element);
}
catch (Exception exc)
{
children = new SystemMessageObject[1];
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
ICommonMessageIds.MSG_EXPAND_FAILED,
IStatus.ERROR,
CommonMessages.MSG_EXPAND_FAILED);
children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element);
SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$
} // message already issued
} }
catch (InterruptedException exc) file.markStale(false);
{
children = new SystemMessageObject[1];
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
ICommonMessageIds.MSG_EXPAND_CANCELLED,
IStatus.CANCEL, CommonMessages.MSG_EXPAND_CANCELLED);
children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element);
}
catch (Exception exc)
{
children = new SystemMessageObject[1];
SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
ICommonMessageIds.MSG_EXPAND_FAILED,
IStatus.ERROR,
CommonMessages.MSG_EXPAND_FAILED);
children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element);
SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$
} // message already issued
} }
file.markStale(false);
return children; return children;
} }