Package javax.jcr

Examples of javax.jcr.PathNotFoundException


         JCRPath srcNodePath = getLocationFactory().parseAbsPath(absPath);
         ItemData srcItemData = dataManager.getItemData(srcNodePath.getInternalPath());

         if (srcItemData == null)
         {
            throw new PathNotFoundException("No node exists at " + absPath);
         }

         exporter.export((NodeData)srcItemData);
      }
      catch (XMLStreamException e)
View Full Code Here


               getTransientNodesManager(), repository.getNamespaceRegistry(), valueFactoryImpl);

         ItemData srcItemData = dataManager.getItemData(Constants.ROOT_UUID);
         if (srcItemData == null)
         {
            throw new PathNotFoundException("Root node not found");
         }

         exporter.export((NodeData)srcItemData);
      }
      catch (XMLStreamException e)
View Full Code Here

         JCRPath srcNodePath = getLocationFactory().parseAbsPath(absPath);
         ItemData srcItemData = dataManager.getItemData(srcNodePath.getInternalPath());
         if (srcItemData == null)
         {
            throw new PathNotFoundException("No node exists at " + absPath);
         }

         exporter.export((NodeData)srcItemData);

      }
View Full Code Here

         JCRPath srcNodePath = getLocationFactory().parseAbsPath(absPath);
         ItemData srcItemData = dataManager.getItemData(srcNodePath.getInternalPath());

         if (srcItemData == null)
         {
            throw new PathNotFoundException("No node exists at " + absPath);
         }

         exporter.export((NodeData)srcItemData);
      }
      catch (XMLStreamException e)
View Full Code Here

      if (item != null)
      {
         return item;
      }

      throw new PathNotFoundException("Item not found " + absPath + " in workspace " + workspaceName);
   }
View Full Code Here

      NodeImpl destParentNode = (NodeImpl)dataManager.getItem(destNodePath.makeParentPath().getInternalPath(), true);

      if (srcNode == null || destParentNode == null)
      {
         throw new PathNotFoundException("No node exists at " + srcAbsPath + " or no node exists one level above "
            + destAbsPath);
      }

      destParentNode.validateChildNode(destNodePath.getName().getInternalName(), ((NodeTypeImpl)srcNode
         .getPrimaryNodeType()).getQName());
View Full Code Here

            return creationDate;

         }
         else
         {
            throw new PathNotFoundException("Property not found " + CREATIONDATE);
         }

      }
      else if (name.equals(HASCHILDREN))
      {
         if (node.getNodes().getSize() > 0)
         {
            return new HierarchicalProperty(name, "1");
         }
         else
         {
            return new HierarchicalProperty(name, "0");
         }

      }
      else if (name.equals(ISCOLLECTION))
      {
         return new HierarchicalProperty(name, "1");

      }
      else if (name.equals(ISFOLDER))
      {
         return new HierarchicalProperty(name, "1");

      }
      else if (name.equals(ISROOT))
      {
         return new HierarchicalProperty(name, (node.getDepth() == 0) ? "1" : "0");

      }
      else if (name.equals(PARENTNAME))
      {
         if (node.getDepth() == 0)
         {
            throw new PathNotFoundException();
         }
         return new HierarchicalProperty(name, node.getParent().getName());

      }
      else if (name.equals(RESOURCETYPE))
      {
         HierarchicalProperty collectionProp = new HierarchicalProperty(new QName("DAV:", "collection"));
         HierarchicalProperty resourceType = new HierarchicalProperty(name);
         resourceType.addChild(collectionProp);
         return resourceType;

      }
      else if (name.equals(SUPPORTEDLOCK))
      {
         if (!node.canAddMixin("mix:lockable"))
         {
            throw new PathNotFoundException();
         }
         return supportedLock();

      }
      else if (name.equals(LOCKDISCOVERY))
      {
         if (node.isLocked())
         {
            String token = node.getLock().getLockToken();
            String owner = node.getLock().getLockOwner();

            return lockDiscovery(token, owner, "86400");
         }
         throw new PathNotFoundException();

      }
      else if (name.equals(ISVERSIONED))
      {
         return new HierarchicalProperty(name, "0");

      }
      else if (name.equals(SUPPORTEDMETHODSET))
      {
         return supportedMethodSet();

      }
      else if (name.equals(ORDERING_TYPE))
      {
         if (node.getPrimaryNodeType().hasOrderableChildNodes())
         {
            HierarchicalProperty orderingType = new HierarchicalProperty(name);

            // <D:href>DAV:custom</D:href>

            HierarchicalProperty orderHref = orderingType.addChild(new HierarchicalProperty(new QName("DAV:", "href")));
            orderHref.setValue("DAV:custom");

            return orderingType;
         }
         throw new PathNotFoundException();

      }
      else
      {

         if ("DAV:".equals(name.getNamespaceURI()))
         {
            throw new PathNotFoundException();
         }

         Property property = node.getProperty(WebDavNamespaceContext.createName(name));

         if (property.getDefinition().isMultiple())
View Full Code Here

      }
      else if (name.equals(SUPPORTEDLOCK))
      {
         if (!node.canAddMixin("mix:lockable"))
         {
            throw new PathNotFoundException();
         }
         return supportedLock();
      }
      else if (name.equals(LOCKDISCOVERY))
      {
         if (node.isLocked())
         {
            String token = node.getLock().getLockToken();
            String owner = node.getLock().getLockOwner();
            return lockDiscovery(token, owner, "86400");
         }
         else
         {
            throw new PathNotFoundException();
         }
      }
      else if (name.equals(ISVERSIONED))
      {
         return new HierarchicalProperty(name, "0");
      }
      else if (name.equals(SUPPORTEDMETHODSET))
      {
         return supportedMethodSet();
      }
      else
      {
         try
         {
            Property property = node.getProperty(WebDavNamespaceContext.createName(name));
            String propertyValue;
            if (property.getDefinition().isMultiple())
            {
               if (property.getValues().length == 0)
               {
                  throw new PathNotFoundException();
               }

               propertyValue = property.getValues()[0].getString();
            }
            else
View Full Code Here

      checkInitialized();
      JCRPath path = session.getLocationFactory().parseAbsPath(absPath);
      QPath qpath = path.getInternalPath();
      NodeImpl parent = (NodeImpl)session.getTransientNodesManager().getItem(qpath.makeParentPath(), false);
      if (parent == null)
         throw new PathNotFoundException("Parent not found for " + path.getAsString(false));

      // validate as on parent child node
      parent.validateChildNode(qpath.getName(), Constants.NT_QUERY);

      NodeData queryData =
View Full Code Here

         dataManager.getItem(nodeData(), itemPath.makeParentPath().getInternalPath().getEntries(), false,
            ItemType.UNKNOWN);

      if (parentItem == null)
      {
         throw new PathNotFoundException("Parent not found for " + itemPath.getAsString(true));
      }
      if (!parentItem.isNode())
      {
         throw new ConstraintViolationException("Parent item is not a node " + parentItem.getPath());
      }
View Full Code Here

TOP

Related Classes of javax.jcr.PathNotFoundException

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.