I found a bug on the Move command on the WebdavService in combination
with DocumentPath.

DocumentPath changes the path to a collection in the repository to one
without the last '/'. So "content/appdata/" will be "content/appdata"
when used with the move command. This will generate an error on the
repository side.

We have made a workaround with the following code:

    public synchronized void move(final String old, final String
newPath) throws RepositoryException {

        DocumentPath oldPath =
webdavService.getBasePath().createRelativePath(old);
        DocumentPath nieuwPath =
webdavService.getBasePath().createRelativePath(hippoRepoPath +
newPath);

        oldPath =
webdavService.getBasePath().createAbsolutePath(oldPath.getFullPath() +
"//");

        try {
            webdavService.executeMove(oldPath, newPath, true);
        } catch (ClientException ce) {
            log.debug("Problem with repository: " + ce.getMessage());
            throw new RepositoryException(ErrorCode.HIPPO_REPOSITORY,
"Could not move category", ce);
        }

    }

Is this a known problem with webdav or the DocumentPath class?

With regards,

Nick Stolwijk
~Java Developer~

Iprofs BV.
Claus Sluterweg 125
2012 WS Haarlem
www.iprofs.nl
********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Searchable archives can be found at:
MarkMail: http://hippocms-dev.markmail.org
Nabble: http://www.nabble.com/Hippo-CMS-f26633.html

Reply via email to