Lines 19-25
Link Here
|
19 |
* David McKnight (IBM) - [196035] Wrapper SystemMessageExceptions for createFile and createFolder with RemoteFileSecurityException |
19 |
* David McKnight (IBM) - [196035] Wrapper SystemMessageExceptions for createFile and createFolder with RemoteFileSecurityException |
20 |
* Kevin Doyle (IBM) - [191548] Deleting Read-Only directory removes it from view and displays no error |
20 |
* Kevin Doyle (IBM) - [191548] Deleting Read-Only directory removes it from view and displays no error |
21 |
* Xuan Chen (IBM) - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted" |
21 |
* Xuan Chen (IBM) - [202670] [Supertransfer] After doing a copy to a directory that contains folders some folders name's display "deleted" |
22 |
* Xuan Chen (IBM) - [190824] Incorrect result for DStore#getSeparator() function when parent is "/" |
22 |
* Xuan Chen (IBM) - [190824] Incorrect result for DStore#getSeparator() function when parent is "/" |
|
|
23 |
* David McKnight (IBM) - [207095] check for null datastore |
23 |
********************************************************************************/ |
24 |
********************************************************************************/ |
24 |
|
25 |
|
25 |
package org.eclipse.rse.internal.services.dstore.files; |
26 |
package org.eclipse.rse.internal.services.dstore.files; |
Lines 105-110
Link Here
|
105 |
super.uninitService(monitor); |
106 |
super.uninitService(monitor); |
106 |
_fileElementMap.clear(); |
107 |
_fileElementMap.clear(); |
107 |
_dstoreFileMap.clear(); |
108 |
_dstoreFileMap.clear(); |
|
|
109 |
_uploadLogElement = null; |
108 |
} |
110 |
} |
109 |
|
111 |
|
110 |
public String getName() |
112 |
public String getName() |
Lines 149-155
Link Here
|
149 |
|
151 |
|
150 |
protected String getDataStoreRoot() |
152 |
protected String getDataStoreRoot() |
151 |
{ |
153 |
{ |
152 |
return getDataStore().getAttribute(DataStoreAttributes.A_LOCAL_PATH); |
154 |
DataStore ds = getDataStore(); |
|
|
155 |
if (ds != null) |
156 |
return ds.getAttribute(DataStoreAttributes.A_LOCAL_PATH); |
157 |
return null; |
153 |
} |
158 |
} |
154 |
|
159 |
|
155 |
|
160 |
|
Lines 172-199
Link Here
|
172 |
|
177 |
|
173 |
protected void setDataStoreRoot(String root) |
178 |
protected void setDataStoreRoot(String root) |
174 |
{ |
179 |
{ |
175 |
getDataStore().setAttribute(DataStoreAttributes.A_LOCAL_PATH, root); |
180 |
DataStore ds = getDataStore(); |
|
|
181 |
if (ds != null) |
182 |
ds.setAttribute(DataStoreAttributes.A_LOCAL_PATH, root); |
176 |
} |
183 |
} |
177 |
|
184 |
|
178 |
protected DataElement findUploadLog() |
185 |
protected DataElement findUploadLog() |
179 |
{ |
186 |
{ |
180 |
DataElement minerInfo = getMinerElement(); |
187 |
DataElement minerInfo = getMinerElement(); |
181 |
if (_uploadLogElement == null || _uploadLogElement.getDataStore() != getDataStore()) |
188 |
DataStore ds = getDataStore(); |
|
|
189 |
if (_uploadLogElement == null || _uploadLogElement.getDataStore() != ds) |
182 |
{ |
190 |
{ |
183 |
_uploadLogElement = getDataStore().find(minerInfo, DE.A_NAME, "universal.uploadlog", 2); //$NON-NLS-1$ |
191 |
if (ds != null) |
|
|
192 |
{ |
193 |
_uploadLogElement = ds.find(minerInfo, DE.A_NAME, "universal.uploadlog", 2); //$NON-NLS-1$ |
194 |
} |
195 |
else |
196 |
{ |
197 |
return null; |
198 |
} |
184 |
} |
199 |
} |
185 |
return _uploadLogElement; |
200 |
return _uploadLogElement; |
186 |
} |
201 |
} |
187 |
|
202 |
|
188 |
protected DataElement getAttributes(String fileNameFilter, boolean showHidden) |
203 |
protected DataElement getAttributes(String fileNameFilter, boolean showHidden) |
189 |
{ |
204 |
{ |
190 |
DataElement attributes = getDataStore().createTransientObject(_filterAttributes); |
205 |
DataStore ds = getDataStore(); |
191 |
String version = IServiceConstants.VERSION_1; |
206 |
if (ds != null) |
192 |
StringBuffer buffer = new StringBuffer(); |
207 |
{ |
193 |
String filter = ((fileNameFilter == null) ? "*" : fileNameFilter); //$NON-NLS-1$ |
208 |
DataElement attributes = ds.createTransientObject(_filterAttributes); |
194 |
buffer.append(version).append(IServiceConstants.TOKEN_SEPARATOR).append(filter).append(IServiceConstants.TOKEN_SEPARATOR).append(showHidden); |
209 |
String version = IServiceConstants.VERSION_1; |
195 |
attributes.setAttribute(DE.A_SOURCE, buffer.toString()); |
210 |
StringBuffer buffer = new StringBuffer(); |
196 |
return attributes; |
211 |
String filter = ((fileNameFilter == null) ? "*" : fileNameFilter); //$NON-NLS-1$ |
|
|
212 |
buffer.append(version).append(IServiceConstants.TOKEN_SEPARATOR).append(filter).append(IServiceConstants.TOKEN_SEPARATOR).append(showHidden); |
213 |
attributes.setAttribute(DE.A_SOURCE, buffer.toString()); |
214 |
return attributes; |
215 |
} |
216 |
else |
217 |
{ |
218 |
return null; |
219 |
} |
197 |
} |
220 |
} |
198 |
|
221 |
|
199 |
|
222 |
|
Lines 776-785
Link Here
|
776 |
buf.append(name); |
799 |
buf.append(name); |
777 |
de = getElementFor(buf.toString()); |
800 |
de = getElementFor(buf.toString()); |
778 |
} |
801 |
} |
779 |
dsQueryCommand(de, IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT, monitor); |
802 |
|
780 |
//getFile call should also need to convert this DataElement into a HostFile using |
803 |
// with 207095, it's possible to get here unconnected such that there is no element |
781 |
//convertToHostFile() call. This way, this DataElement will be put into _fileMap. |
804 |
if (de != null) { |
782 |
return convertToHostFile(de); |
805 |
dsQueryCommand(de, IUniversalDataStoreConstants.C_QUERY_GET_REMOTE_OBJECT, monitor); |
|
|
806 |
//getFile call should also need to convert this DataElement into a HostFile using |
807 |
//convertToHostFile() call. This way, this DataElement will be put into _fileMap. |
808 |
return convertToHostFile(de); |
809 |
} |
810 |
else { |
811 |
return null; |
812 |
} |
783 |
} |
813 |
} |
784 |
|
814 |
|
785 |
/** |
815 |
/** |
Lines 1284-1289
Link Here
|
1284 |
waitForInitialize(null); |
1314 |
waitForInitialize(null); |
1285 |
} |
1315 |
} |
1286 |
|
1316 |
|
|
|
1317 |
DataStore ds = getDataStore(); |
1318 |
|
1319 |
// with 207095, it's possible to get here when disconnected and no dstore |
1320 |
if (ds == null){ |
1321 |
return null; |
1322 |
} |
1287 |
|
1323 |
|
1288 |
String normalizedPath = PathUtility.normalizeUnknown(path); |
1324 |
String normalizedPath = PathUtility.normalizeUnknown(path); |
1289 |
DataElement element = (DataElement)_fileElementMap.get(normalizedPath); |
1325 |
DataElement element = (DataElement)_fileElementMap.get(normalizedPath); |
Lines 1295-1301
Link Here
|
1295 |
if (element == null || element.isDeleted()) |
1331 |
if (element == null || element.isDeleted()) |
1296 |
{ |
1332 |
{ |
1297 |
DataElement universaltemp = getMinerElement(); |
1333 |
DataElement universaltemp = getMinerElement(); |
1298 |
element = getDataStore().createObject(universaltemp, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR, normalizedPath, normalizedPath, "", false); //$NON-NLS-1$ |
1334 |
element = ds.createObject(universaltemp, IUniversalDataStoreConstants.UNIVERSAL_FILTER_DESCRIPTOR, normalizedPath, normalizedPath, "", false); //$NON-NLS-1$ |
1299 |
} |
1335 |
} |
1300 |
return element; |
1336 |
return element; |
1301 |
} |
1337 |
} |
Lines 1314-1321
Link Here
|
1314 |
protected IHostFile[] fetch(String remoteParent, String fileFilter, String queryType, IProgressMonitor monitor) |
1350 |
protected IHostFile[] fetch(String remoteParent, String fileFilter, String queryType, IProgressMonitor monitor) |
1315 |
{ |
1351 |
{ |
1316 |
DataStore ds = getDataStore(); |
1352 |
DataStore ds = getDataStore(); |
1317 |
|
1353 |
if (ds == null) |
1318 |
|
1354 |
{ |
|
|
1355 |
return new IHostFile[0]; |
1356 |
} |
1357 |
|
1319 |
// create filter descriptor |
1358 |
// create filter descriptor |
1320 |
DataElement deObj = getElementFor(remoteParent); |
1359 |
DataElement deObj = getElementFor(remoteParent); |
1321 |
if (deObj == null) |
1360 |
if (deObj == null) |
Lines 1343-1357
Link Here
|
1343 |
String remotePath = parent + getSeparator(parent) + name; |
1382 |
String remotePath = parent + getSeparator(parent) + name; |
1344 |
DataElement de = getElementFor(remotePath); |
1383 |
DataElement de = getElementFor(remotePath); |
1345 |
DataStore ds = de.getDataStore(); |
1384 |
DataStore ds = de.getDataStore(); |
1346 |
|
1385 |
if (ds != null) |
1347 |
|
|
|
1348 |
DataElement setCmd = getCommandDescriptor(de, IUniversalDataStoreConstants.C_SET_LASTMODIFIED); |
1349 |
if (setCmd != null) |
1350 |
{ |
1386 |
{ |
1351 |
// first modify the source attribute to temporarily be the date field |
1387 |
DataElement setCmd = getCommandDescriptor(de, IUniversalDataStoreConstants.C_SET_LASTMODIFIED); |
1352 |
de.setAttribute(DE.A_SOURCE, timestamp + ""); //$NON-NLS-1$ |
1388 |
if (setCmd != null) |
1353 |
ds.command(setCmd, de, true); |
1389 |
{ |
1354 |
return true; |
1390 |
// first modify the source attribute to temporarily be the date field |
|
|
1391 |
de.setAttribute(DE.A_SOURCE, timestamp + ""); //$NON-NLS-1$ |
1392 |
ds.command(setCmd, de, true); |
1393 |
return true; |
1394 |
} |
1355 |
} |
1395 |
} |
1356 |
|
1396 |
|
1357 |
return false; |
1397 |
return false; |
Lines 1363-1385
Link Here
|
1363 |
String remotePath = parent + getSeparator(parent) + name; |
1403 |
String remotePath = parent + getSeparator(parent) + name; |
1364 |
DataElement de = getElementFor(remotePath); |
1404 |
DataElement de = getElementFor(remotePath); |
1365 |
DataStore ds = de.getDataStore(); |
1405 |
DataStore ds = de.getDataStore(); |
1366 |
|
1406 |
if (ds != null) |
1367 |
|
|
|
1368 |
DataElement setCmd = getCommandDescriptor(de, IUniversalDataStoreConstants.C_SET_READONLY); |
1369 |
if (setCmd != null) |
1370 |
{ |
1407 |
{ |
1371 |
String flag = readOnly ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$ |
1408 |
DataElement setCmd = getCommandDescriptor(de, IUniversalDataStoreConstants.C_SET_READONLY); |
1372 |
de.setAttribute(DE.A_SOURCE, flag); |
1409 |
if (setCmd != null) |
1373 |
DataElement status = ds.command(setCmd, de, true); |
|
|
1374 |
try |
1375 |
{ |
1376 |
getStatusMonitor(ds).waitForUpdate(status); |
1377 |
} |
1378 |
catch (Exception e) |
1379 |
{ |
1410 |
{ |
|
|
1411 |
String flag = readOnly ? "true" : "false"; //$NON-NLS-1$ //$NON-NLS-2$ |
1412 |
de.setAttribute(DE.A_SOURCE, flag); |
1413 |
DataElement status = ds.command(setCmd, de, true); |
1414 |
try |
1415 |
{ |
1416 |
getStatusMonitor(ds).waitForUpdate(status); |
1417 |
} |
1418 |
catch (Exception e) |
1419 |
{ |
1380 |
|
1420 |
|
|
|
1421 |
} |
1422 |
return true; |
1381 |
} |
1423 |
} |
1382 |
return true; |
|
|
1383 |
} |
1424 |
} |
1384 |
return false; |
1425 |
return false; |
1385 |
} |
1426 |
} |
Lines 1394-1413
Link Here
|
1394 |
if (remoteEncoding == null) { |
1435 |
if (remoteEncoding == null) { |
1395 |
|
1436 |
|
1396 |
DataStore ds = getDataStore(); |
1437 |
DataStore ds = getDataStore(); |
|
|
1438 |
if (ds != null) |
1439 |
{ |
1440 |
DataElement encodingElement = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_TEMP_DESCRIPTOR, ""); //$NON-NLS-1$ |
1441 |
|
1442 |
DataElement queryCmd = ds.localDescriptorQuery(encodingElement.getDescriptor(),IUniversalDataStoreConstants.C_SYSTEM_ENCODING); |
1397 |
|
1443 |
|
1398 |
DataElement encodingElement = ds.createObject(null, IUniversalDataStoreConstants.UNIVERSAL_TEMP_DESCRIPTOR, ""); //$NON-NLS-1$ |
1444 |
DataElement status = ds.command(queryCmd, encodingElement, true); |
1399 |
|
|
|
1400 |
DataElement queryCmd = ds.localDescriptorQuery(encodingElement.getDescriptor(),IUniversalDataStoreConstants.C_SYSTEM_ENCODING); |
1401 |
|
1402 |
DataElement status = ds.command(queryCmd, encodingElement, true); |
1403 |
|
1445 |
|
1404 |
try { |
1446 |
try { |
1405 |
getStatusMonitor(ds).waitForUpdate(status); |
1447 |
getStatusMonitor(ds).waitForUpdate(status); |
1406 |
} |
1448 |
} |
1407 |
catch (Exception e) { |
1449 |
catch (Exception e) { |
1408 |
} |
1450 |
} |
1409 |
|
1451 |
|
1410 |
remoteEncoding = encodingElement.getValue(); |
1452 |
remoteEncoding = encodingElement.getValue(); |
|
|
1453 |
} |
1411 |
} |
1454 |
} |
1412 |
|
1455 |
|
1413 |
return remoteEncoding; |
1456 |
return remoteEncoding; |