-
1. Re: File upload via REST API
hchiorean Mar 13, 2015 4:29 AM (in response to sdotlittlenail)ModeShape 3 does not have this feature via the REST service. ModeShape 4 has it via 2 new /upload methods REST Service - ModeShape 4 - Project Documentation Editor
-
2. Re: File upload via REST API
sdotlittlenail Mar 13, 2015 7:23 AM (in response to hchiorean)thank you very much!
Another question: What about the REST Client API to upload files programmatically via REST? Is it still supported/recommended for ModeShape 3 and 4?
https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Data_Services/5/html/Metadata_Repository_Reference_Guide/… -
3. Re: File upload via REST API
hchiorean Mar 13, 2015 8:04 AM (in response to sdotlittlenail)The REST Client API has been removed altogether from ModeShape 4.
In ModeShape 3 the purpose of the client was never to be used externally, but rather only by the remote JDBC driver. ModeShape 3 is at the end of its community life, but if the client works for your use case, fell free to use it.
-
4. Re: File upload via REST API
sdotlittlenail Mar 16, 2015 9:26 AM (in response to hchiorean)REST Client API does not seem to work that successfully.
"ERROR org.modeshape.web.jcr.rest.client.json.JsonRestClient - response code=404 method=createFolderNode"
File file = new File("C:\"tsDocument.xml");
Server server = new Server("http://localhost:8080", "myUser", "myFancyPasswd");
Repository repository = new Repository("artifacts", server);
Workspace workspace = new Workspace("default", repository);
IRestClient restClient = new JsonRestClient();
Status status = restClient.publish(workspace, "test", file);Afaik artifacts is my repository and I'm using the default workspace.
At least I can access the default workspace straightforward by webdav: http://localhost:8080/modeshape-webdav/artifacts/default/