Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 323299 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/rse/internal/files/ui/view/SystemViewRemoteFileAdapter.java (-49 / +61 lines)
Lines 67-72 Link Here
67
 * David McKnight   (IBM)        - [309813] RSE permits opening of file after access removed
67
 * David McKnight   (IBM)        - [309813] RSE permits opening of file after access removed
68
 * David McKnight   (IBM)        - [308221] Bidi3.6: Improper display of date in Properties and Table Views
68
 * David McKnight   (IBM)        - [308221] Bidi3.6: Improper display of date in Properties and Table Views
69
 * David McKnight   (IBM)        - [317541] Show blank as the last modified for a file with no last modified
69
 * David McKnight   (IBM)        - [317541] Show blank as the last modified for a file with no last modified
70
 * David McKnight   (IBM)        - [323299] [files] remote file view adapter needs to use the latest version of IRemoteFile
70
 *******************************************************************************/
71
 *******************************************************************************/
71
72
72
package org.eclipse.rse.internal.files.ui.view;
73
package org.eclipse.rse.internal.files.ui.view;
Lines 168-173 Link Here
168
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile;
169
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFile;
169
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileEmpty;
170
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileEmpty;
170
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileRoot;
171
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileRoot;
172
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
171
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResultsContentsType;
173
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteSearchResultsContentsType;
172
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
174
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
173
import org.eclipse.rse.ui.ISystemContextMenuConstants;
175
import org.eclipse.rse.ui.ISystemContextMenuConstants;
Lines 647-652 Link Here
647
			return ((RemoteFileRoot) file).getRootFiles();
649
			return ((RemoteFileRoot) file).getRootFiles();
648
		}
650
		}
649
		IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem();
651
		IRemoteFileSubSystem ss = file.getParentRemoteFileSubSystem();
652
		
653
		// make sure we have the lastest cached version otherwise could be working with a bad file that never got marked as stale
654
		if (ss instanceof RemoteFileSubSystem){
655
			IRemoteFile cachedFile = ((RemoteFileSubSystem)ss).getCachedRemoteFile(file.getAbsolutePath());
656
			if (cachedFile != null){
657
				file = cachedFile;
658
			}
659
		}
650
660
651
661
652
		/*
662
		/*
Lines 746-810 Link Here
746
		    }
756
		    }
747
		}
757
		}
748
758
749
		boolean hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter);
759
		synchronized (file){
750
760
			boolean hasChildren = file.hasContents(RemoteChildrenContentsType.getInstance(), filter);
751
		if (hasChildren && !file.isStale())
761
	
752
		{
762
			if (hasChildren && !file.isStale())
753
			children = file.getContents(RemoteChildrenContentsType.getInstance(), filter);
754
			children = filterChildren(children);
755
		}
756
		else
757
		{
758
			try
759
			{
763
			{
760
			    if (monitor != null)
764
				children = file.getContents(RemoteChildrenContentsType.getInstance(), filter);
761
			    {
765
				children = filterChildren(children);
762
766
			}
763
			        children = ss.resolveFilterString(file, filter, monitor);
767
			else
764
			    }
768
			{
765
			    else
769
				try
766
			    {
767
			        children = ss.resolveFilterString(file, filter, new NullProgressMonitor());
768
			    }
769
770
				if ((children == null) || (children.length == 0))
771
				{
772
					children = EMPTY_LIST;
773
				}
774
				else
775
				{
770
				{
776
					if (children.length == 1 && children[0] instanceof SystemMessageObject)
771
				    if (monitor != null)
772
				    {
773
	
774
				        children = ss.resolveFilterString(file, filter, monitor);
775
				    }
776
				    else
777
				    {
778
				        children = ss.resolveFilterString(file, filter, new NullProgressMonitor());
779
				    }
780
	
781
					if ((children == null) || (children.length == 0))
777
					{
782
					{
778
						// don't filter children so that the message gets propagated
783
						children = EMPTY_LIST;
779
					}
784
					}
780
					else
785
					else
781
					{
786
					{
782
						children = filterChildren(children);
787
						if (children.length == 1 && children[0] instanceof SystemMessageObject)
788
						{
789
							// don't filter children so that the message gets propagated
790
						}
791
						else
792
						{
793
							children = filterChildren(children);
794
						}
783
					}
795
					}
796
	
784
				}
797
				}
785
798
				catch (InterruptedException exc)
786
			}
799
				{
787
			catch (InterruptedException exc)
800
					children = new SystemMessageObject[1];
788
			{
801
					SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
789
				children = new SystemMessageObject[1];
802
							ICommonMessageIds.MSG_EXPAND_CANCELLED,
790
				SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
803
							IStatus.CANCEL, CommonMessages.MSG_EXPAND_CANCELLED);
791
						ICommonMessageIds.MSG_EXPAND_CANCELLED,
804
					children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element);
792
						IStatus.CANCEL, CommonMessages.MSG_EXPAND_CANCELLED);
805
				}
793
				children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_CANCEL, element);
806
				catch (Exception exc)
807
				{
808
					children = new SystemMessageObject[1];
809
	
810
					SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
811
							ICommonMessageIds.MSG_EXPAND_FAILED,
812
							IStatus.ERROR,
813
							CommonMessages.MSG_EXPAND_FAILED);
814
					children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element);
815
					SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$
816
				} // message already issued
794
			}
817
			}
795
			catch (Exception exc)
818
			file.markStale(false);
796
			{
797
				children = new SystemMessageObject[1];
798
799
				SystemMessage msg = new SimpleSystemMessage(Activator.PLUGIN_ID,
800
						ICommonMessageIds.MSG_EXPAND_FAILED,
801
						IStatus.ERROR,
802
						CommonMessages.MSG_EXPAND_FAILED);
803
				children[0] = new SystemMessageObject(msg, ISystemMessageObject.MSGTYPE_ERROR, element);
804
				SystemBasePlugin.logError("Exception resolving file filter strings", exc); //$NON-NLS-1$
805
			} // message already issued
806
		}
819
		}
807
		file.markStale(false);
808
		return children;
820
		return children;
809
	}
821
	}
810
822

Return to bug 323299