mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-02 22:55:26 +02:00
[249544] some backward compatibility issues with old IBM dstore server
This commit is contained in:
parent
ab611483be
commit
592e9a2d04
1 changed files with 58 additions and 1 deletions
|
@ -49,6 +49,7 @@
|
|||
* David McKnight (IBM) - [236039][dstore][efs] DStoreInputStream can report EOF too early - clean up how it waits for the local temp file to be created
|
||||
* David McKnight (IBM) - [240710] [dstore] DStoreFileService.getFile() fails with NPE for valid root files
|
||||
* David McKnight (IBM) - [249544] Save conflict dialog appears when saving files in the editor
|
||||
* David McKnight (IBM) - [249544] some backward compatibility issues with old IBM dstore server
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.dstore.files;
|
||||
|
@ -197,8 +198,31 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
return IUniversalDataStoreConstants.UNIVERSAL_FILESYSTEM_MINER_ID;
|
||||
}
|
||||
|
||||
protected String getByteStreamHandlerId()
|
||||
protected DataElement getMinerElement()
|
||||
{
|
||||
super.getMinerElement();
|
||||
if (_minerElement == null){
|
||||
// could be back-level version
|
||||
_minerElement = getMinerElement("com.ibm.etools.systems.universal.miners.UniversalFileSystemMiner"); //$NON-NLS-1$
|
||||
}
|
||||
return _minerElement;
|
||||
}
|
||||
|
||||
private boolean isOldIBMMiner()
|
||||
{
|
||||
if (_minerElement != null){
|
||||
return _minerElement.getSource().equals("com.ibm.etools.systems.universal.miners.UniversalFileSystemMiner"); //$NON-NLS-1$
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected String getByteStreamHandlerId()
|
||||
{
|
||||
if (isOldIBMMiner())
|
||||
{
|
||||
// if so, use the old id
|
||||
return "com.ibm.etools.systems.universal.miners.UniversalByteStreamHandler"; //$NON-NLS-1$
|
||||
}
|
||||
return UniversalByteStreamHandler.class.getName();
|
||||
}
|
||||
|
||||
|
@ -1138,8 +1162,25 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
de = getElementFor(name);
|
||||
}
|
||||
|
||||
|
||||
// with 207095, it's possible to get here unconnected such that there is no element
|
||||
if (de != null) {
|
||||
if (isOldIBMMiner()){
|
||||
// only accepts filters for file queries
|
||||
if (!de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR)){
|
||||
StringBuffer buf = new StringBuffer(remoteParent);
|
||||
String sep = getSeparator(remoteParent);
|
||||
if (sep.length()>0 && !remoteParent.endsWith(sep)) {
|
||||
buf.append(sep);
|
||||
}
|
||||
buf.append(name);
|
||||
String fullPath = buf.toString();
|
||||
de.setAttribute(DE.A_NAME, fullPath);
|
||||
de.setAttribute(DE.A_VALUE, fullPath);
|
||||
de.setAttribute(DE.A_TYPE, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR);
|
||||
}
|
||||
}
|
||||
|
||||
dsQueryCommand(de, null, IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT, monitor);
|
||||
//getFile call should also need to convert this DataElement into a HostFile using
|
||||
//convertToHostFile() call. This way, this DataElement will be put into _fileMap.
|
||||
|
@ -1160,9 +1201,25 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
|
||||
// construct default array of commands
|
||||
String[] queryStrings = new String[remoteParents.length];
|
||||
boolean oldMiner = isOldIBMMiner();
|
||||
|
||||
for (int i = 0; i < queryStrings.length; i++)
|
||||
{
|
||||
queryStrings[i] = IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT;
|
||||
if (oldMiner){
|
||||
if (!subjects[i].getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR)){
|
||||
StringBuffer buf = new StringBuffer(remoteParents[i]);
|
||||
String sep = getSeparator(remoteParents[i]);
|
||||
if (sep.length()>0 && !remoteParents[i].endsWith(sep)) {
|
||||
buf.append(sep);
|
||||
}
|
||||
buf.append(names[i]);
|
||||
String fullPath = buf.toString();
|
||||
subjects[i].setAttribute(DE.A_NAME, fullPath);
|
||||
subjects[i].setAttribute(DE.A_VALUE, fullPath);
|
||||
subjects[i].setAttribute(DE.A_TYPE, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dsQueryCommandMulti(subjects, null, queryStrings, monitor);
|
||||
|
|
Loading…
Add table
Reference in a new issue