if(CarbonUtils.isRunningOnLocalTransportMode()) {
stub = new FileDownloadServiceStub(configCtxService.getServerConfigContext(), serviceEPR);
} else {
stub = new FileDownloadServiceStub(configCtxService.getClientConfigContext(), serviceEPR);
}
DataHandler dataHandler = stub.downloadFile(fileID);
if (dataHandler != null) {
response.setHeader("Content-Disposition", "filename=" + fileID);
response.setContentType(dataHandler.getContentType());
InputStream in = dataHandler.getDataSource().getInputStream();
int nextChar;