FileUrlParts.category.get(category), FileUrlParts.fileId.get(file.getFileId()),
FileUrlParts.libraryFilter.get(libraryFilter), FileUrlParts.libraryId.get(libraryId));
Map<String, String> headers = new HashMap<String, String>();
headers.put(Headers.ContentType, Headers.BINARY);
Response response = null;
response = getClientService().get(requestUrl, params, headers, ClientService.FORMAT_INPUTSTREAM);
InputStream istream = (InputStream) response.getData();
long noOfBytes = 0;
try {
if (istream != null) {
noOfBytes = StreamUtil.copyStream(istream, ostream);
ostream.flush();