class SingleRepositoryServiceImpl implements SingleRepositoryService {

    @Override
    public Resource updateResource(Resource resource, boolean dryRun) throws ResourceNotFoundException, VersionNotMatchException {
        if(!dryRun) {
            try {
                if (resource instanceof Folder) {
                    repositoryService.saveFolder(null, (Folder) resource);
                } else {
                    repositoryService.saveResource(null, resource);
                }
            } catch (JSResourceVersionNotMatchException e) {
                throw new VersionNotMatchException();
            } catch (JSExceptionWrapper w) {
                throw getRootException(w);
            }
        }
        return dryRun ? resource : getResource(resource.getURIString());
    }

}