Ejemplo n.º 1
0
 /*
  * (non-Javadoc)
  *
  * @see com.gcrm.dao.IDocumentDao#save(com.gcrm.domain.Document,
  * java.io.File)
  */
 @SuppressWarnings("resource")
 public Document save(Document document, File f) throws Exception {
   if (f != null) {
     InputStream stream = new BufferedInputStream(new FileInputStream(f));
     byte[] input = new byte[stream.available()];
     stream.read(input);
     document.setFileContent(input);
   }
   return super.makePersistent(document);
 }