protected void doGet(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException { final String uuid = req.getParameter("uuid"); if (uuid == null) { res.sendError(SC_BAD_REQUEST); } final AssetItem asset = repository.loadAssetByUUID(uuid); if (asset == null) { res.sendError(SC_NO_CONTENT); return; } final ServiceConfig serviceConfig = ServiceConfigPersistence.getInstance().unmarshal(asset.getContent()); try { res.setContentType("application/x-download"); res.setHeader("Content-Disposition", "attachment; filename=drools-service.war;"); buildWar(serviceConfig, repository, res.getOutputStream()); } catch (Throwable e) { ((OutputStream) res.getOutputStream()).close(); res.sendError(SC_INTERNAL_SERVER_ERROR, e.getMessage()); } finally { } }