ConfigurationStore store = mgr.getStoreForConfiguration(artifact);
try {
response.setContentType("application/zip");
String filename = artifact.getArtifactId() + "-" + artifact.getVersion() + "." + artifact.getType();
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(filename, "UTF-8"));
store.exportConfiguration(artifact, response.getOutputStream());
} catch (NoSuchConfigException e) {
throw new ServletException("No such configuration '"+configId+"'");
}
}
}