if (fileInfo == null)
{
throw new FileSystemException(FILE_NOT_FOUND, file);
}
final RepositoryFileDto fileDto = fileInfo.getFile();
if (fileDto == null)
{
throw new IllegalStateException(BI_SERVER_NULL_OBJECT);
}
final String path = normalizePath(fileDto.getPath());
String urlPath = path;
try{urlPath = URLEncoder.encodeUTF8(path).replaceAll("\\!", "%21").replaceAll("\\+", "%2B");}catch(Exception ex){}//tcb
final String service = MessageFormat.format(DOWNLOAD_SERVICE, urlPath);
return client.resource(url + service).accept(MediaType.APPLICATION_XML_TYPE).get(byte[].class);