}
}
private void writeFileToStream(String url, OutputStream stream) throws IOException {
if (url.startsWith(File.getFileDownloadPrefix())) {
GenericFile fileFromURL = FileDownloadServlet.getFileFromURL(url);
if (fileFromURL != null) {
InputStream inputStream = fileFromURL.getStream();
ByteStreams.copy(inputStream, stream);
inputStream.close();
stream.close();
}