protected void doGet(final HttpServletRequest req,
final HttpServletResponse res) throws ServletException,
IOException {
doAuthorizedAction(req, res, new A() {
public void a() throws Exception {
RestAPI api = getAPI();
String qString = req.getQueryString();
String ur = req.getRequestURI();
if (qString != null && qString.length() > 0) {
ur = ur + '?' + qString;
}
Response apiRes = api.get(ur);
res.setContentType( "application/x-download" );
res.setHeader( "Content-Disposition",
"attachment; filename=data;");
apiRes.writeData(res.getOutputStream());
res.getOutputStream().flush();