Question

I'm using ModeShape 2.8.2 and JBoss 7.1.1. ModeShape rest server deployed as usual web application. And I have a kind of a stupid question.

I can to publish a file - it uploads to the storage and everything is fine.

But when I try to unpublish - I have an exception.

According to the api I have to provide workspace, path and file as parameters. But is there any examples how to combine path and file parameters?

For example, I want to unpublish node at /repo/file path. The following code not working:

File file = new File("file");
Status status = restClient.unpublish(workspace, "/repo", file);

log:

12:53:26,163 ERROR [org.modeshape.web.jcr.rest.client.json.JsonRestClient] (http
--127.0.0.1-8080-1) response code=405 method=unpublish
12:53:26,166 ERROR [com.demo.app.Controller]
(http--127.0.0.1-8080-1) The file "C:\jboss-as-7.1.1.Final\bin\file" could not be unpublished in workspace "workspa
ce1" at path "/repo".: java.lang.RuntimeException: The file "file" could n
ot be unpublished in workspace "workspace1" at path "/repo".

But an url from (new FileNode(workspace,"/repo",file).getUrl() is correct and get request to the url returns details about the node.

Thank you for any help. Have a good day!

Was it helpful?

Solution

It was a bug and it's resolved in 3.0 Modeshape's version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top