Package org.apache.jackrabbit.webdav.jcr

Examples of org.apache.jackrabbit.webdav.jcr.JcrDavException


                if (!getRepositorySession(resource).itemExists(resource.getLocator().getRepositoryPath())) {
                    throw new DavException(DavServletResponse.SC_CONFLICT, "Unable to start local transaction: no repository item present at " + getResourcePath());
                }
            } catch (RepositoryException e) {
                log.error("Unexpected error: " + e.getMessage());
                throw new JcrDavException(e);
            }
        }
View Full Code Here


         */
        public void commit(TransactionResource resource) throws DavException {
            try {
                getItem(resource).save();
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        }
View Full Code Here

         */
        public void rollback(TransactionResource resource) throws DavException {
            try {
                getItem(resource).refresh(false);
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        }
View Full Code Here

                        depth = getDepth((Node) item);
                    }
                    writer.write((Node) item, depth);
                } else {
                    // properties cannot be requested as json object.
                    throw new JcrDavException(new ItemNotFoundException("No node at " + item.getPath()), DavServletResponse.SC_NOT_FOUND);
                }
            } catch (RepositoryException e) {
                // should only get here if the item does not exist.
                log.debug(e.getMessage());
                throw new JcrDavException(e);
            }
        } else {
            super.doGet(webdavRequest, webdavResponse, davResource);
        }
    }
View Full Code Here

                    webdavResponse.setHeader(DeltaVConstants.HEADER_LOCATION, loc);
                    webdavResponse.setStatus(HttpServletResponse.SC_CREATED);
                }
            } catch (RepositoryException e) {
                log.warn(e.getMessage());
                throw new JcrDavException(e);
            } catch (DiffException e) {
                log.warn(e.getMessage());
                Throwable cause = e.getCause();
                if (cause instanceof RepositoryException) {
                    throw new JcrDavException((RepositoryException) cause);
                } else {
                    throw new DavException(DavServletResponse.SC_BAD_REQUEST, "Invalid diff format.");
                }
            } finally {
                data.dispose();
View Full Code Here

            Node item = getNode();
            try {
                item.addMixin(JcrConstants.MIX_VERSIONABLE);
                item.save();
            } catch (RepositoryException e) {
                throw new JcrDavException(e);
            }
        } // else: is already version controlled -> ignore
    }
View Full Code Here

            Version v = getNode().checkin();
            String versionHref = getLocatorFromNode(v).getHref(false);
            return versionHref;
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
        }
    }
View Full Code Here

        }
        try {
            getNode().checkout();
        } catch (RepositoryException e) {
            // UnsupportedRepositoryException should not occur
            throw new JcrDavException(e);
        }
    }
View Full Code Here

                ((VersionResource)resArr[0]).label(labelInfo);
            } else {
                throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR, "DAV:checked-in property on '" + getHref() + "' did not point to a single VersionResource.");
            }
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
    }
View Full Code Here

            } else {
                // severe error since resource factory doesn't behave correctly.
                throw new DavException(DavServletResponse.SC_INTERNAL_SERVER_ERROR);
            }
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.jcr.JcrDavException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.