Hi,

I'm using a custom client to put documents in my remote repository (5.2-RC1). I've no problems connecting or creating files, but I can't achieve in getting back the files : I used the same code as in the sample : http://www.nuxeo.org/xwiki/bin/view/FAQ/SampleRemoteJava/

Here is my code:
public boolean getFile(String docId, File f) throws GedRepositoryException {
       DocumentModel doc;
       try {
           doc = documentManager.getDocument(new IdRef(docId));
           Blob b = (Blob)doc.getPropertyValue("file:content");
           if (b != null){
               FileOutputStream fos = new FileOutputStream(f);
               FileUtils.copy(b.getStream(), fos);
               return true;
           }
       } catch (Exception e) {
throw new GedRepositoryException("Récupération du doc impossible", e);
       }
       return false;
   }

And here is the exception thrown :

Caused by: java.lang.NullPointerException
   at java.io.FileInputStream.<init>(Unknown Source)
   at org.nuxeo.ecm.core.storage.sql.Binary.getStream(Binary.java:78)
at org.nuxeo.ecm.core.storage.sql.coremodel.SQLBlob.getStream(SQLBlob.java:68) at org.nuxeo.ecm.core.api.impl.blob.StreamBlob.getByteArray(StreamBlob.java:169) at org.cocktail.ged.provider.NuxeoProvider.getFile(NuxeoProvider.java:446)
   ... 15 more

The error is the same if I try to get files already present in the repository...
The filename and filesize are ok.

Thanks for any clue.
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm
To unsubscribe, go to http://lists.nuxeo.com/mailman/options/ecm

Reply via email to