I'm using nuxeo-http-client 5.2. Compiled it with JSE 5. Here is my
sample code...
NuxeoServer nxServer = new NuxeoServer("http://127.0.0.1:8080/nuxeo");
nxServer.setBasicAuthentication("Administrator", "Administrator");
List<String> pathParams = Arrays.asList(
"default", "609d14c0-8382-4769-9e36-441a6bcab66a",
"testing.xml", "upload");
FileInputStream istream = new FileInputStream(new
File("/Users/ilya/Desktop/ids.txt"));
Representation res = nxServer.doRestletPostCall(pathParams, null, istream);
System.err.println("RESPONSE: " + res.getText());
The response that I get is...
<?xml version="1.0" encoding="UTF-8"?>
<error message="the request was rejected because its size is unknown"
class="org.apache.commons.fileupload.FileUploadBase.UnknownSizeException"/>
I was also trying to just use curl in order to invoke the request...
curl -u Administrator:Administrator -F "title=testing&[email protected]"
http://localhost:8080/nuxeo/restAPI/default/609d14c0-8382-4769-9e36-441a6bcab66a/testing.pdf/upload
This works and uploads the file, but it names the file file.pdf vs.
testing.pdf specified. I guess I'm trying to get more info on the
REST api. First it seems rather that it's not very restful at least
from my trials below (I hope I'm really wrong about this). I think I
should be able to upload files using their respective content type,
not having to use multipart/form-data. But i'd be happy to use any
http based api at this point, if you can point me towards more
comprehensive documentation and/or examples.
Also, is http/REST api a stable/well supported API, or would you
recommend using other APIs (RMI, SOAP)?
Thanks.
_______________________________________________
ECM mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm