* @param filename - File to stream
* @param removeOnFinish - Delete file after streaming?
* @return File streaming output.
*/
public static StreamingOutput streamingFileOutput(final String filename, final boolean removeOnFinish) {
return new StreamingOutput() {
public void write(OutputStream output) throws IOException, WebApplicationException {
// Read file, write to output buffer and close stream...
File file = new File(filename);
BufferedInputStream in = new java.io.BufferedInputStream(