Lines 48-53
Link Here
|
48 |
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote |
48 |
* Martin Oberhuber (Wind River) - [235463][ftp][dstore] Incorrect case sensitivity reported on windows-remote |
49 |
* 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 |
49 |
* 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 |
50 |
* David McKnight (IBM) - [240710] [dstore] DStoreFileService.getFile() fails with NPE for valid root files |
50 |
* David McKnight (IBM) - [240710] [dstore] DStoreFileService.getFile() fails with NPE for valid root files |
|
|
51 |
* David McKnight (IBM) - [250140] backport of Save conflict dialog appears when saving files in the editor |
52 |
* David McKnight (IBM) - [250368] Backport [dstore] Remote search doesn't find the right result |
51 |
*******************************************************************************/ |
53 |
*******************************************************************************/ |
52 |
|
54 |
|
53 |
package org.eclipse.rse.internal.services.dstore.files; |
55 |
package org.eclipse.rse.internal.services.dstore.files; |
Lines 74-79
Link Here
|
74 |
import org.eclipse.dstore.core.model.DataStore; |
76 |
import org.eclipse.dstore.core.model.DataStore; |
75 |
import org.eclipse.dstore.core.model.DataStoreAttributes; |
77 |
import org.eclipse.dstore.core.model.DataStoreAttributes; |
76 |
import org.eclipse.dstore.core.model.DataStoreResources; |
78 |
import org.eclipse.dstore.core.model.DataStoreResources; |
|
|
79 |
import org.eclipse.dstore.core.model.DataStoreSchema; |
77 |
import org.eclipse.dstore.core.model.IDataStoreProvider; |
80 |
import org.eclipse.dstore.core.model.IDataStoreProvider; |
78 |
import org.eclipse.osgi.util.NLS; |
81 |
import org.eclipse.osgi.util.NLS; |
79 |
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; |
82 |
import org.eclipse.rse.dstore.universal.miners.IUniversalDataStoreConstants; |
Lines 195-202
Link Here
|
195 |
return IUniversalDataStoreConstants.UNIVERSAL_FILESYSTEM_MINER_ID; |
198 |
return IUniversalDataStoreConstants.UNIVERSAL_FILESYSTEM_MINER_ID; |
196 |
} |
199 |
} |
197 |
|
200 |
|
198 |
protected String getByteStreamHandlerId() |
201 |
protected DataElement getMinerElement() |
|
|
202 |
{ |
203 |
super.getMinerElement(); |
204 |
if (_minerElement == null){ |
205 |
// could be back-level version |
206 |
_minerElement = getMinerElement("com.ibm.etools.systems.universal.miners.UniversalFileSystemMiner"); //$NON-NLS-1$ |
207 |
} |
208 |
return _minerElement; |
209 |
} |
210 |
|
211 |
private boolean isOldIBMMiner() |
199 |
{ |
212 |
{ |
|
|
213 |
if (_minerElement != null){ |
214 |
return _minerElement.getSource().equals("com.ibm.etools.systems.universal.miners.UniversalFileSystemMiner"); //$NON-NLS-1$ |
215 |
} |
216 |
return false; |
217 |
} |
218 |
|
219 |
protected String getByteStreamHandlerId() |
220 |
{ |
221 |
if (isOldIBMMiner()) |
222 |
{ |
223 |
// if so, use the old id |
224 |
return "com.ibm.etools.systems.universal.miners.UniversalByteStreamHandler"; //$NON-NLS-1$ |
225 |
} |
200 |
return UniversalByteStreamHandler.class.getName(); |
226 |
return UniversalByteStreamHandler.class.getName(); |
201 |
} |
227 |
} |
202 |
|
228 |
|
Lines 457-467
Link Here
|
457 |
boolean transferSuccessful = false; |
483 |
boolean transferSuccessful = false; |
458 |
|
484 |
|
459 |
long totalBytes = file.length(); |
485 |
long totalBytes = file.length(); |
|
|
486 |
|
487 |
DataElement uploadLog = findUploadLog(); |
488 |
String remotePath = remoteParent + getSeparator(remoteParent) + remoteFile; |
489 |
|
490 |
DataStore ds = getDataStore(); |
491 |
DataElement result = ds.find(uploadLog, DE.A_NAME, remotePath,1); |
492 |
if (result == null) |
493 |
{ |
494 |
result = ds.createObject(uploadLog, "uploadstatus", remotePath); |
495 |
result.setAttribute(DE.A_SOURCE, "running"); |
496 |
result.setAttribute(DE.A_VALUE, ""); |
497 |
|
498 |
DataElement cmd = getDataStore().findCommandDescriptor(DataStoreSchema.C_SET); |
499 |
|
500 |
DataElement setstatus = ds.command(cmd, uploadLog, true); |
501 |
} |
460 |
|
502 |
|
461 |
try |
503 |
try |
462 |
{ |
504 |
{ |
463 |
String byteStreamHandlerId = getByteStreamHandlerId(); |
505 |
String byteStreamHandlerId = getByteStreamHandlerId(); |
464 |
String remotePath = remoteParent + getSeparator(remoteParent) + remoteFile; |
506 |
|
465 |
|
507 |
|
466 |
// create an empty file and append data to it later |
508 |
// create an empty file and append data to it later |
467 |
// this handles the case of uploading empty files as well |
509 |
// this handles the case of uploading empty files as well |
Lines 473-481
Link Here
|
473 |
//subMonitor = new SubProgressMonitor(monitor, (int)totalBytes); |
515 |
//subMonitor = new SubProgressMonitor(monitor, (int)totalBytes); |
474 |
} |
516 |
} |
475 |
|
517 |
|
476 |
|
|
|
477 |
// DataElement uploadLog = findUploadLog(); |
478 |
findUploadLog(); |
479 |
// listener = new FileTransferStatusListener(remotePath, shell, monitor, getConnectorService(), ds, uploadLog); |
518 |
// listener = new FileTransferStatusListener(remotePath, shell, monitor, getConnectorService(), ds, uploadLog); |
480 |
// ds.getDomainNotifier().addDomainListener(listener); |
519 |
// ds.getDomainNotifier().addDomainListener(listener); |
481 |
|
520 |
|
Lines 583-588
Link Here
|
583 |
|
622 |
|
584 |
available = bufInputStream.available(); |
623 |
available = bufInputStream.available(); |
585 |
} |
624 |
} |
|
|
625 |
|
586 |
// if (listener.uploadHasFailed()) |
626 |
// if (listener.uploadHasFailed()) |
587 |
// { |
627 |
// { |
588 |
// showUploadFailedMessage(listener, source); |
628 |
// showUploadFailedMessage(listener, source); |
Lines 639-664
Link Here
|
639 |
{ |
679 |
{ |
640 |
if (transferSuccessful) |
680 |
if (transferSuccessful) |
641 |
{ |
681 |
{ |
642 |
|
682 |
String resultStr = result.getSource(); |
643 |
|
683 |
while (!resultStr.equals("success")) |
644 |
// try |
684 |
{ |
645 |
// { |
685 |
// sleep until the upload is complete |
646 |
// listener.waitForUpdate(null, 2); |
686 |
try { |
647 |
// |
687 |
Thread.sleep(200); |
648 |
// } |
688 |
} |
649 |
// catch (InterruptedException e) |
689 |
catch (InterruptedException e){ |
650 |
// { |
690 |
} |
651 |
// UniversalSystemPlugin.logError(CLASSNAME + " InterruptedException while waiting for command", e); |
691 |
resultStr = result.getSource(); |
652 |
// } |
692 |
} |
653 |
|
|
|
654 |
} |
693 |
} |
655 |
|
|
|
656 |
//ds.getDomainNotifier().removeDomainListener(listener); |
657 |
|
658 |
// if (listener.uploadHasFailed()) |
659 |
// { |
660 |
// showUploadFailedMessage(listener, source); |
661 |
// } |
662 |
} |
694 |
} |
663 |
} |
695 |
} |
664 |
} |
696 |
} |
Lines 1130-1137
Link Here
|
1130 |
de = getElementFor(name); |
1162 |
de = getElementFor(name); |
1131 |
} |
1163 |
} |
1132 |
|
1164 |
|
|
|
1165 |
|
1133 |
// with 207095, it's possible to get here unconnected such that there is no element |
1166 |
// with 207095, it's possible to get here unconnected such that there is no element |
1134 |
if (de != null) { |
1167 |
if (de != null) { |
|
|
1168 |
if (isOldIBMMiner()){ |
1169 |
// only accepts filters for file queries |
1170 |
if (!de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR)){ |
1171 |
StringBuffer buf = new StringBuffer(remoteParent); |
1172 |
String sep = getSeparator(remoteParent); |
1173 |
if (sep.length()>0 && !remoteParent.endsWith(sep)) { |
1174 |
buf.append(sep); |
1175 |
} |
1176 |
buf.append(name); |
1177 |
String fullPath = buf.toString(); |
1178 |
de.setAttribute(DE.A_NAME, fullPath); |
1179 |
de.setAttribute(DE.A_VALUE, fullPath); |
1180 |
de.setAttribute(DE.A_TYPE, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR); |
1181 |
} |
1182 |
} |
1183 |
|
1135 |
dsQueryCommand(de, null, IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT, monitor); |
1184 |
dsQueryCommand(de, null, IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT, monitor); |
1136 |
//getFile call should also need to convert this DataElement into a HostFile using |
1185 |
//getFile call should also need to convert this DataElement into a HostFile using |
1137 |
//convertToHostFile() call. This way, this DataElement will be put into _fileMap. |
1186 |
//convertToHostFile() call. This way, this DataElement will be put into _fileMap. |
Lines 1152-1160
Link Here
|
1152 |
|
1201 |
|
1153 |
// construct default array of commands |
1202 |
// construct default array of commands |
1154 |
String[] queryStrings = new String[remoteParents.length]; |
1203 |
String[] queryStrings = new String[remoteParents.length]; |
|
|
1204 |
boolean oldMiner = isOldIBMMiner(); |
1205 |
|
1155 |
for (int i = 0; i < queryStrings.length; i++) |
1206 |
for (int i = 0; i < queryStrings.length; i++) |
1156 |
{ |
1207 |
{ |
1157 |
queryStrings[i] = IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT; |
1208 |
queryStrings[i] = IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT; |
|
|
1209 |
if (oldMiner){ |
1210 |
if (!subjects[i].getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR)){ |
1211 |
StringBuffer buf = new StringBuffer(remoteParents[i]); |
1212 |
String sep = getSeparator(remoteParents[i]); |
1213 |
if (sep.length()>0 && !remoteParents[i].endsWith(sep)) { |
1214 |
buf.append(sep); |
1215 |
} |
1216 |
buf.append(names[i]); |
1217 |
String fullPath = buf.toString(); |
1218 |
subjects[i].setAttribute(DE.A_NAME, fullPath); |
1219 |
subjects[i].setAttribute(DE.A_VALUE, fullPath); |
1220 |
subjects[i].setAttribute(DE.A_TYPE, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR); |
1221 |
} |
1222 |
} |
1158 |
} |
1223 |
} |
1159 |
|
1224 |
|
1160 |
dsQueryCommandMulti(subjects, null, queryStrings, monitor); |
1225 |
dsQueryCommandMulti(subjects, null, queryStrings, monitor); |