I would have preferred not marshalling to a String first, but I realize you did it this way so you could share code with the artifact download servlet.  So I guess it's fine.