Skip to content

Instantly share code, notes, and snippets.

@mmattozzi
Created September 9, 2009 14:58
Show Gist options
  • Save mmattozzi/183777 to your computer and use it in GitHub Desktop.
Save mmattozzi/183777 to your computer and use it in GitHub Desktop.
@GET
@Produces({"application/atom+xml"})
public Response getChannelPermission (@PathParam(ACCOUNT_ELEMENT) String accountId) {
final Feed feed = generateChannelAtomFeed(accountId);
StreamingOutput s = new StreamingOutput() {
@Override
public void write(OutputStream output) throws IOException,
WebApplicationException {
XmlWriter writer = new XmlWriter(new OutputStreamWriter(output));
feed.generateAtom(writer, new ExtensionProfile());
}
};
Response.ResponseBuilder builder = Response.ok(s);
builder.header("ETag", "fjahsjghakjhgkajhdgjkhag");
Response r = builder.build();
return r;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment