FileResource file = new FileResource();
file.setFilePath(filePath);
file.setFileContent(paginator.readPage(page));
file.setHasNext(paginator.pageCount() > page + 1);
file.setPage(page);
file.setPageCount(paginator.pageCount());
JSONObject object = new JSONObject();
object.put("file", file);
return Response.ok(object).status(200).build();
} catch (WebApplicationException ex) {