1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-19 14:15: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

@ -69,7 +69,7 @@ public class ByteStreamHandler implements IByteStreamHandler
remotePath = new String(remotePath.replace('\\', '/'));
DataElement status = findStatusFor(remotePath);
String fileName = _dataStore.mapToLocalPath(remotePath);
if (fileName != null)
{
try
@ -190,6 +190,8 @@ public class ByteStreamHandler implements IByteStreamHandler
{
FileOutputStream outStream = new FileOutputStream(fileName, true);
try
{
if (binary)
{
outStream.write(buffer, 0, size);
@ -201,8 +203,14 @@ public class ByteStreamHandler implements IByteStreamHandler
byte[] convertedBytes = byteConverter.convertClientBytesToHostBytes(buffer, 0, size);
outStream.write(convertedBytes, 0, convertedBytes.length);
}
}
catch (Exception e)
{
e.printStackTrace();
}
outStream.close();
}
if (status == null)
return;

View file

@ -3036,6 +3036,7 @@ public final class DataStore
*/
public String mapToLocalPath(String aPath)
{
/*
String result = null;
char slash = '/';
@ -3067,8 +3068,12 @@ public final class DataStore
result = new String(localRoot + remotePath);
}
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 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;
_dataStore = dataStore;

View file

@ -302,7 +302,9 @@ public class UniversalFileSystemMiner extends Miner implements
"C_GET_OSTYPE - subject is null", null);
} else if (C_DOWNLOAD_FILE.equals(name)) {
if (subject != null)
{
return handleDownload(theElement, status);
}
else
UniversalServerUtilities.logError(CLASSNAME, C_DOWNLOAD_FILE
+ " - subject is null", null);
@ -2249,14 +2251,14 @@ private DataElement createDataElementFromLSString(DataElement subject,
str[i] = tokenizer.nextToken();
}
*/
return ((new Integer(str[3])).intValue());
return ((new Integer(str[3])).intValue());
}
/**
* Method to download a file.
*/
protected DataElement handleDownload(DataElement theElement,
DataElement status) {
protected DataElement handleDownload(DataElement theElement, DataElement status)
{
UniversalDownloadHandler downloadThread = new UniversalDownloadHandler(
_dataStore, this, theElement, status);

View file

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

View file

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