Examples of DavResource


Examples of org.apache.jackrabbit.webdav.DavResource

        try {
            VersionIterator vIter = ((VersionHistory)item).getAllVersions();
            ArrayList l = new ArrayList();
            while (vIter.hasNext()) {
                DavResourceLocator versionLoc = getLocatorFromItem(vIter.nextVersion());
                DavResource vr = createResourceFromLocator(versionLoc);
                l.add(vr);
            }
            return (VersionResource[]) l.toArray(new VersionResource[l.size()]);
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

     * repository root, the returned collection always represent the parent
     * repository node.
     * @see org.apache.jackrabbit.webdav.DavResource#getCollection()
     */
    public DavResource getCollection() {
        DavResource collection = null;

        String resourcePath = getResourcePath();
        // No special treatment for the root-item needed, because this is
        // covered by the RootItemCollection itself.
        String parentResourcePath = Text.getRelativeParent(resourcePath, 1);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

        String prefix = locator.getPrefix();
        DavResourceLocator loc = locator.getFactory().createResourceLocator(prefix, href);

        // create a new resource object
        try {
            DavResource res;
            if (getRepositorySession().itemExists(loc.getRepositoryPath())) {
                res = createResourceFromLocator(loc);
            } else {
                throw new DavException(DavServletResponse.SC_NOT_FOUND);
            }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

     * @param loc
     * @return new <code>DavResource</code>
     */
    protected DavResource createResourceFromLocator(DavResourceLocator loc)
            throws DavException {
        DavResource res = factory.createResource(loc, session);
        if (res instanceof AbstractResource) {
            ((AbstractResource)res).transactionId = this.transactionId;
        }
        return res;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

     * as internal members.
     *
     * @see org.apache.jackrabbit.webdav.DavResource#getCollection()
     */
    public DavResource getCollection() {
        DavResource collection = null;
        // create location with 'null' values for workspace-path and resource-path
        DavResourceLocator parentLoc = getLocator().getFactory().createResourceLocator(getLocator().getPrefix(), null, null);
        try {
            collection = createResourceFromLocator(parentLoc);
        } catch (DavException e) {
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

    private static boolean isInternalMember(DavResource resource, String memberPath) {
  if (resource.getResourcePath().equals(Text.getRelativeParent(memberPath, 1))) {
      // find the member with the given path
      DavResourceIterator it = resource.getMembers();
      while (it.hasNext()) {
    DavResource member = it.nextResource();
    if (member.getResourcePath().equals(memberPath)) {
        // return true if that member is not a collection
        return !member.isCollection();
    }
      }
  }
  return false;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

            Element hrefElem = info.getContentElement(DavConstants.XML_HREF, DavConstants.NAMESPACE);
            String uuid = DomUtil.getTextTrim(hrefElem);
            DavResourceLocator resourceLoc = resource.getLocator();
            Node n = getRepositorySession().getNodeByUUID(uuid);
            DavResourceLocator loc = resourceLoc.getFactory().createResourceLocator(resourceLoc.getPrefix(), resourceLoc.getWorkspacePath(), n.getPath(), false);
            DavResource locatedResource = resource.getFactory().createResource(loc, resource.getSession());
            ms = new MultiStatus();
            ms.addResourceProperties(locatedResource, info.getPropertyNameSet(), info.getDepth());
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

                writer.print(resource.getResourcePath());
                writer.print("</h2><ul>");
                writer.print("<li><a href=\"..\">..</a></li>");
                DavResourceIterator iter = resource.getMembers();
                while (iter.hasNext()) {
                    DavResource child = iter.nextResource();
                    String label = Text.getName(child.getResourcePath());
                    writer.print("<li><a href=\"");
                    writer.print(child.getHref());
                    writer.print("\">");
                    writer.print(label);
                    writer.print("</a></li>");
                }
                writer.print("</ul><hr size=\"1\"><em>Powered by <a href=\"");
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

            sb.append("<body><h2>").append(repostr).append("</h2>");
            sb.append("<h3>Available Workspace Resources:</h3><ul>");

            DavResourceIterator it = getMembers();
            while (it.hasNext()) {
                DavResource res = it.nextResource();
                sb.append("<li><a href=\"");
                sb.append(res.getHref());
                sb.append("\">");
                sb.append(res.getDisplayName());
                sb.append("</a></li>");
            }
            sb.append("</ul><hr size=\"1\"><em>Powered by <a href=\"");
            sb.append(repURL).append("\">").append(repName);
            sb.append("</a> ").append(repVersion);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.DavResource

     * @param loc
     * @return new <code>DavResource</code>
     */
    protected DavResource createResourceFromLocator(DavResourceLocator loc)
            throws DavException {
        DavResource res = getFactory().createResource(loc, getSession());
        return res;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.