mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 13:35:22 +02:00
[209387] should not delete elements for files that still exist (but are filtered out)
This commit is contained in:
parent
c58a9da81b
commit
00690859a4
1 changed files with 20 additions and 3 deletions
|
@ -10,6 +10,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* David McKnight (IBM) - [192884] Should not use filter to determine previous query results
|
* David McKnight (IBM) - [192884] Should not use filter to determine previous query results
|
||||||
|
* David McKnight (IBM) - [209387] Should not delete elements for files that still exist (but are filtered out)
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
|
||||||
|
|
||||||
|
@ -339,10 +340,26 @@ public class FileQueryThread extends QueryThread
|
||||||
} // end for j
|
} // end for j
|
||||||
|
|
||||||
//Object left over in the filteredChildren is no longer in the system any more. Need to remove.
|
//Object left over in the filteredChildren is no longer in the system any more. Need to remove.
|
||||||
|
if (!filteredChildren.isEmpty())
|
||||||
|
{
|
||||||
|
// get the complete list of files (because we're only working with filtered right now
|
||||||
|
String[] completeList = _fileobj.list();
|
||||||
|
|
||||||
Iterator myIterator = filteredChildren.keySet().iterator();
|
Iterator myIterator = filteredChildren.keySet().iterator();
|
||||||
while(myIterator.hasNext())
|
while(myIterator.hasNext())
|
||||||
{
|
{
|
||||||
ds.deleteObject(subject, (DataElement)(filteredChildren.get(myIterator.next())));
|
DataElement oldChild = (DataElement)filteredChildren.get(myIterator.next());
|
||||||
|
String oldName = oldChild.getName();
|
||||||
|
boolean foundOnSystem = false;
|
||||||
|
for (int c = 0; c < completeList.length && !foundOnSystem; c++){
|
||||||
|
if (completeList[c].equals(oldName)){
|
||||||
|
foundOnSystem = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!foundOnSystem){
|
||||||
|
ds.deleteObject(subject, oldChild);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue