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:
parent
bca932fbea
commit
c369e9fbfa
2 changed files with 19 additions and 6 deletions
|
@ -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)
|
||||
|
@ -456,11 +457,21 @@ public class UniversalFileTransferUtility
|
|||
String path = properties.getRemoteFilePath();
|
||||
if (path != null)
|
||||
{
|
||||
IRemoteFile remoteFile = ss.getRemoteFileObject(path, new NullProgressMonitor());
|
||||
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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue