ALF-4865 - transfer service: transfer empty content property

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22682 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2010-09-24 09:51:50 +00:00
parent 0d42709dd2
commit f95cb3c51b
4 changed files with 599 additions and 242 deletions

View File

@@ -307,22 +307,22 @@ public class HttpClientTransmitterImpl implements TransferTransmitter
int responseStatus = httpClient.executeMethod(hostConfig, postSnapshotRequest, httpState);
checkResponseStatus("sendManifest", responseStatus, postSnapshotRequest);
InputStream is = postSnapshotRequest.getResponseBodyAsStream();
InputStreamReader reader = new InputStreamReader(is);
BufferedReader br = new BufferedReader(reader);
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(result));
String s = br.readLine();
while(s != null)
final ReadableByteChannel inputChannel = Channels.newChannel(is);
final WritableByteChannel outputChannel = Channels.newChannel(result);
try
{
bw.write(s);
s = br.readLine();
// copy the channels
channelCopy(inputChannel, outputChannel);
}
bw.close();
finally
{
inputChannel.close();
outputChannel.close();
}
return;
}
catch (RuntimeException e)