I used the below example to test. REST Api works, but it gives result in stream format. But,I expect result with file option. I used this example to ingrate with Angular JS framework.
@GET
@Path("/get")
@Produces("application/vnd.ms-excel")
public Response getFile() {
LOG.info("get - Function begins from here");
File file = new File("/home/test/file.xls");
ResponseBuilder response = Response.ok((Object) file);
response.header("Content-Disposition",
"attachment; filename=new-excel-file.xls");
response.header("Content-Type","application/octet-stream");
return response.build();
}