I am using the following code to download my alfresco HTML content of size 51kb
HttpGet httpget = new HttpGet(url);
System.out.println("executing request" + httpget.getRequestLine());
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
System.out.println("----------------------------------------");
if (entity != null) {
System.out.println("Response content type: " + entity.getContentType());
long contentLength = entity.getContentLength();
System.out.println("Response content length: "+ entity.getContentLength());
if (contentLength > 0) {
b = new byte[(int) contentLength];
entity.getContent().read(b);
content=new String(b);
content=content.replace("\n", "").replace("\r", "");
//content = StringEscapeUtils.escapeHtml(content);
System.out.println("Response content: " + content);
}
}
Only 30-40 % of the HTML content is downloaded and displayed. I am not able to get the full content.
I tried increasing the byte size of b. But nothing worked out for me.
Please help me in download alfresco content using java code. Any help is appreciated. Thanks in advance.