Rivedendo meglio la libreria che uso : javax.activation, potrei fare così :
DataHandler handler =pdfDocument.value;
DataSource dataSource = handler.getDataSource();
File f = new File(dataSource.getName());
FileOutputStream w =new FileOutputStream (f);
handler.writeTo(w);
dove il metodo writeTo retrieves the InputStream and copies the bytes from the InputStream to the OutputStream passed in.


Rispondi quotando