1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-20 06:35:50 +02:00

defect 149133 - use absolute to indicate local receiver file rather than mapping

This commit is contained in:
David McKnight 2006-08-08 15:15:16 +00:00
parent a219176dd1
commit 80981eee1e
6 changed files with 25 additions and 12 deletions

View file

@ -190,6 +190,8 @@ public class ByteStreamHandler implements IByteStreamHandler
{ {
FileOutputStream outStream = new FileOutputStream(fileName, true); FileOutputStream outStream = new FileOutputStream(fileName, true);
try
{
if (binary) if (binary)
{ {
outStream.write(buffer, 0, size); outStream.write(buffer, 0, size);
@ -201,8 +203,14 @@ public class ByteStreamHandler implements IByteStreamHandler
byte[] convertedBytes = byteConverter.convertClientBytesToHostBytes(buffer, 0, size); byte[] convertedBytes = byteConverter.convertClientBytesToHostBytes(buffer, 0, size);
outStream.write(convertedBytes, 0, convertedBytes.length); outStream.write(convertedBytes, 0, convertedBytes.length);
} }
}
catch (Exception e)
{
e.printStackTrace();
}
outStream.close(); outStream.close();
} }
if (status == null) if (status == null)
return; return;

View file

@ -3036,6 +3036,7 @@ public final class DataStore
*/ */
public String mapToLocalPath(String aPath) public String mapToLocalPath(String aPath)
{ {
/*
String result = null; String result = null;
char slash = '/'; char slash = '/';
@ -3069,6 +3070,10 @@ public final class DataStore
} }
return result; return result;
*/
// no more mapping here - expect actual paths
return aPath;
} }
/** /**

View file

@ -46,7 +46,8 @@ public class UniversalDownloadHandler extends Thread implements ICancellableHand
private DataElement _cmdElement; private DataElement _cmdElement;
private boolean _isCancelled= false; private boolean _isCancelled= false;
public UniversalDownloadHandler(DataStore dataStore, UniversalFileSystemMiner miner, DataElement cmdElement, DataElement status) public UniversalDownloadHandler(DataStore dataStore, UniversalFileSystemMiner miner, DataElement cmdElement,
DataElement status)
{ {
_miner = miner; _miner = miner;
_dataStore = dataStore; _dataStore = dataStore;

View file

@ -302,7 +302,9 @@ public class UniversalFileSystemMiner extends Miner implements
"C_GET_OSTYPE - subject is null", null); "C_GET_OSTYPE - subject is null", null);
} else if (C_DOWNLOAD_FILE.equals(name)) { } else if (C_DOWNLOAD_FILE.equals(name)) {
if (subject != null) if (subject != null)
{
return handleDownload(theElement, status); return handleDownload(theElement, status);
}
else else
UniversalServerUtilities.logError(CLASSNAME, C_DOWNLOAD_FILE UniversalServerUtilities.logError(CLASSNAME, C_DOWNLOAD_FILE
+ " - subject is null", null); + " - subject is null", null);
@ -2255,8 +2257,8 @@ private DataElement createDataElementFromLSString(DataElement subject,
/** /**
* Method to download a file. * Method to download a file.
*/ */
protected DataElement handleDownload(DataElement theElement, protected DataElement handleDownload(DataElement theElement, DataElement status)
DataElement status) { {
UniversalDownloadHandler downloadThread = new UniversalDownloadHandler( UniversalDownloadHandler downloadThread = new UniversalDownloadHandler(
_dataStore, this, theElement, status); _dataStore, this, theElement, status);

View file

@ -601,9 +601,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
// String tempRoot = getDataStoreRoot(); // String tempRoot = getDataStoreRoot();
getDataStoreRoot(); getDataStoreRoot();
String dataStoreLocalPath = prepareForDownload(localFile.getAbsolutePath()); DataElement localElement = ds.createObject(universaltemp, de.getType(), localFile.getAbsolutePath(), encoding);
DataElement localElement = ds.createObject(universaltemp, de.getType(), dataStoreLocalPath, encoding);
DataElement bufferSizeElement = ds.createObject(universaltemp, "buffer_size", "" + getBufferDownloadSize(), ""); DataElement bufferSizeElement = ds.createObject(universaltemp, "buffer_size", "" + getBufferDownloadSize(), "");
DataElement queryCmd = getCommandDescriptor(de,C_DOWNLOAD_FILE); DataElement queryCmd = getCommandDescriptor(de,C_DOWNLOAD_FILE);
@ -629,6 +627,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
} }
catch (InterruptedException e) catch (InterruptedException e)
{ {
e.printStackTrace();
} }
//getStatusMonitor(ds).waitForUpdate(status, monitor); //getStatusMonitor(ds).waitForUpdate(status, monitor);

View file

@ -118,7 +118,6 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons
{ {
if (_status.getValue().equals("done")) if (_status.getValue().equals("done"))
{ {
if (_status == event.getParent()) if (_status == event.getParent())
{ {
setDone(true); setDone(true);
@ -295,7 +294,6 @@ public class DownloadListener implements IDomainListener,IUniversalDataStoreCons
setDone(true); setDone(true);
throw new InterruptedException(); throw new InterruptedException();
} }
if (getStatus().getAttribute(DE.A_NAME).equals("done")) if (getStatus().getAttribute(DE.A_NAME).equals("done"))
{ {
setDone(true); setDone(true);