Galera, fiz um servlet para realizar downloads dos arquivos. O troço parece que funciona direito, o arquivo vem com o tamanho certo e tudo, mas vem corrompido!! Vou deixar o código aqui e caso alguém saiba o problema posta aí!!!
File file = getFile(request);
ServletOutputStream outputStream = response.getOutputStream();
ServletContext context = getServletContext();
String mimetype = getMimeType(file.getName());
response.setContentType( (mimetype != null) ? mimetype : "application/octet-stream" );
//talvez role exception aqui...
response.setContentLength((int)file.length());
response.setHeader( "Content-Disposition", "attachment; filename=\"" + file.getName() + "\"" );
FileInputStream is = new FileInputStream(file);
int c = 0;
byte[] buffer = new byte[4096];
while((c=is.read())!=-1){
outputStream.write(buffer,0,c);
}
is.close();
outputStream.flush();
outputStream.close();
Valeu!!
Alberto