1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 02:35:37 +02:00

[181553] need to make cached files stale when doing the discard check

Also, for dstore need to make sure we invalidate the file type if the file no longer exists since a valid file type will indicate that the file exists
This commit is contained in:
David McKnight 2007-04-27 18:28:39 +00:00
parent bca932fbea
commit c369e9fbfa
2 changed files with 19 additions and 6 deletions

View file

@ -69,6 +69,7 @@ import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSyst
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin;
@ -446,7 +447,7 @@ public class UniversalFileTransferUtility
try
{
IResource[] members = folder.members();
for (int i = 0; i < members.length; i++)
for (int i = members.length -1; i >= 0; i--)
{
IResource member = members[i];
if (member instanceof IFile)
@ -454,13 +455,23 @@ public class UniversalFileTransferUtility
// is this a valid replica?
SystemIFileProperties properties = new SystemIFileProperties(member);
String path = properties.getRemoteFilePath();
if (path != null)
{
IRemoteFile remoteFile = ss.getRemoteFileObject(path, new NullProgressMonitor());
if (path != null)
{
IRemoteFile remoteFile = null;
if (ss instanceof RemoteFileSubSystem)
{
// mark any cached remote file stale so we know for sure
remoteFile = ((RemoteFileSubSystem)ss).getCachedRemoteFile(path);
if (remoteFile != null)
{
remoteFile.markStale(true);
}
}
remoteFile = ss.getRemoteFileObject(path, new NullProgressMonitor());
if (remoteFile != null && !remoteFile.exists())
{
// this must be old so we should delete this
member.delete(false, new NullProgressMonitor());
member.delete(true, new NullProgressMonitor());
}
}
}

View file

@ -1503,7 +1503,7 @@ private DataElement createDataElementFromLSString(DataElement subject,
{
String name = subject.getName();
String path = subject.getValue();
fileobj = new File(path, name);
fileobj = new File(path, name);
}
else if (queryType.equals(IUniversalDataStoreConstants.UNIVERSAL_FOLDER_DESCRIPTOR))
{
@ -1632,6 +1632,8 @@ private DataElement createDataElementFromLSString(DataElement subject,
e.printStackTrace();
}
} else {
// change the file type
subject.setAttribute(DE.A_TYPE, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR);
subject.setAttribute(DE.A_SOURCE, setProperties(fileobj));
status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED_WITH_DOES_NOT_EXIST);
}