Path.denotesRoot
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.apache.jackrabbit.spi.Path.denotesRoot(Showing top 15 results out of 315)

origin: org.apache.jackrabbit/jackrabbit-core

/**
 * {@inheritDoc}
 */
public final ItemId resolvePath(Path path) throws RepositoryException {
  // shortcut
  if (path.denotesRoot()) {
    return rootNodeId;
  }
  if (!path.isCanonical()) {
    String msg = "path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return resolvePath(path, RETURN_ANY);
}
origin: apache/jackrabbit

private Node getNode(NodeId id, SessionInfoImpl sessionInfo) throws ItemNotFoundException, PathNotFoundException, RepositoryException {
  Session session = sessionInfo.getSession();
  Node n;
  if (id.getUniqueID() != null) {
    n = session.getNodeByIdentifier(id.getUniqueID());
  } else {
    n = session.getRootNode();
  }
  Path path = id.getPath();
  if (path == null || path.denotesRoot()) {
    return n;
  }
  String jcrPath;
  jcrPath = sessionInfo.getNamePathResolver().getJCRPath(path);
  if (path.isAbsolute()) {
    jcrPath = jcrPath.substring(1, jcrPath.length());
  }
  return n.getNode(jcrPath);
}
origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * @see HierarchyManager#getPropertyEntry(Path)
 */
public PropertyEntry getPropertyEntry(Path qPath)
    throws PathNotFoundException, RepositoryException {
  // shortcut
  if (qPath.denotesRoot()) {
    throw new PathNotFoundException("The root path never points to a Property.");
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return getRootEntry().getDeepPropertyEntry(qPath);
}
origin: org.apache.jackrabbit/jackrabbit-spi-commons

/**
 * This default implementation first calls {@link #checkSessionInfo(SessionInfo)}
 * with the <code>sessionInfo</code>, then lazily initializes {@link #rootNodeDefinition}
 * if <code>nodeId</code> denotes the root node; otherwise throws a
 * {@link UnsupportedRepositoryOperationException}.
 */
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo,
                     NodeId nodeId)
    throws RepositoryException {
  checkSessionInfo(sessionInfo);
  if (nodeId.getUniqueID() == null && nodeId.getPath().denotesRoot()) {
    synchronized (this) {
      if (rootNodeDefinition == null) {
        rootNodeDefinition = createRootNodeDefinition(sessionInfo);
      }
      return rootNodeDefinition;
    }
  }
  throw new UnsupportedRepositoryOperationException();
}
origin: org.apache.jackrabbit/jackrabbit-core

/**
 * @see RetentionRegistry#hasEffectiveRetention(org.apache.jackrabbit.spi.Path,boolean)
 */
public boolean hasEffectiveRetention(Path nodePath, boolean checkParent) throws RepositoryException {
  if (!initialized) {
    throw new IllegalStateException("Not initialized.");
  }
  if (retentionCnt <= 0) {
    return false;
  }
  RetentionPolicy rp = null;
  PathMap.Element<RetentionPolicyImpl> element = retentionMap.map(nodePath, true);
  if (element != null) {
    rp = element.get();
  }
  if (rp == null && checkParent && (!nodePath.denotesRoot())) {
    element = retentionMap.map(nodePath.getAncestor(1), true);
    if (element != null) {
      rp = element.get();
    }
  }
  return rp != null;
}
origin: org.apache.jackrabbit/jackrabbit-spi-commons

/**
 * Uses {@link NamePathResolver#getJCRPath(Path)} to convert the
 * <code>Path</code> present with this constraint into a JCR path.
 *
 * @see ValueConstraint#getDefinition(NamePathResolver)
 * @param resolver name-path resolver
 */
@Override
public String getDefinition(NamePathResolver resolver) {
  try {
    String p = resolver.getJCRPath(path);
    if (!deep) {
      return p;
    } else if (path.denotesRoot()) {
      return p + "*";
    } else {
      return p + "/*";
    }
  } catch (NamespaceException e) {
    // should never get here, return raw definition as fallback
    return getString();
  }
}
origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * @see HierarchyManager#getNodeEntry(Path)
 */
public NodeEntry getNodeEntry(Path qPath) throws PathNotFoundException, RepositoryException {
  NodeEntry rootEntry = getRootEntry();
  // shortcut
  if (qPath.denotesRoot()) {
    return rootEntry;
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return rootEntry.getDeepNodeEntry(qPath);
}
origin: org.apache.jackrabbit/jackrabbit-core

/**
 * {@inheritDoc}
 */
public final ItemId resolvePath(Path path) throws RepositoryException {
  // shortcut
  if (path.denotesRoot()) {
    return rootNodeId;
  }
  if (!path.isCanonical()) {
    String msg = "path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return resolvePath(path, RETURN_ANY);
}
origin: apache/jackrabbit

/**
 * {@inheritDoc}
 */
public final ItemId resolvePath(Path path) throws RepositoryException {
  // shortcut
  if (path.denotesRoot()) {
    return rootNodeId;
  }
  if (!path.isCanonical()) {
    String msg = "path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return resolvePath(path, RETURN_ANY);
}
origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * @see HierarchyManager#getPropertyEntry(Path)
 */
public PropertyEntry getPropertyEntry(Path qPath)
    throws PathNotFoundException, RepositoryException {
  // shortcut
  if (qPath.denotesRoot()) {
    throw new PathNotFoundException("The root path never points to a Property.");
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return getRootEntry().getDeepPropertyEntry(qPath);
}
origin: apache/jackrabbit

/**
 * @see HierarchyManager#getPropertyEntry(Path)
 */
public PropertyEntry getPropertyEntry(Path qPath)
    throws PathNotFoundException, RepositoryException {
  // shortcut
  if (qPath.denotesRoot()) {
    throw new PathNotFoundException("The root path never points to a Property.");
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return getRootEntry().getDeepPropertyEntry(qPath);
}
origin: apache/jackrabbit

/**
 * @see HierarchyManager#getNodeEntry(Path)
 */
public NodeEntry getNodeEntry(Path qPath) throws PathNotFoundException, RepositoryException {
  NodeEntry rootEntry = getRootEntry();
  // shortcut
  if (qPath.denotesRoot()) {
    return rootEntry;
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return rootEntry.getDeepNodeEntry(qPath);
}
origin: org.apache.jackrabbit/jackrabbit-jcr2spi

/**
 * @see HierarchyManager#getNodeEntry(Path)
 */
public NodeEntry getNodeEntry(Path qPath) throws PathNotFoundException, RepositoryException {
  NodeEntry rootEntry = getRootEntry();
  // shortcut
  if (qPath.denotesRoot()) {
    return rootEntry;
  }
  if (!qPath.isCanonical()) {
    String msg = "Path is not canonical";
    log.debug(msg);
    throw new RepositoryException(msg);
  }
  return rootEntry.getDeepNodeEntry(qPath);
}
origin: org.apache.jackrabbit/jackrabbit-spi-commons

/**
 * This default implementation first calls {@link #checkSessionInfo(SessionInfo)}
 * with the <code>sessionInfo</code>, then lazily initializes {@link #rootNodeDefinition}
 * if <code>nodeId</code> denotes the root node; otherwise throws a
 * {@link UnsupportedRepositoryOperationException}.
 */
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo,
                     NodeId nodeId)
    throws RepositoryException {
  checkSessionInfo(sessionInfo);
  if (nodeId.getUniqueID() == null && nodeId.getPath().denotesRoot()) {
    synchronized (this) {
      if (rootNodeDefinition == null) {
        rootNodeDefinition = createRootNodeDefinition(sessionInfo);
      }
      return rootNodeDefinition;
    }
  }
  throw new UnsupportedRepositoryOperationException();
}
origin: apache/jackrabbit

/**
 * This default implementation first calls {@link #checkSessionInfo(SessionInfo)}
 * with the <code>sessionInfo</code>, then lazily initializes {@link #rootNodeDefinition}
 * if <code>nodeId</code> denotes the root node; otherwise throws a
 * {@link UnsupportedRepositoryOperationException}.
 */
public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo,
                     NodeId nodeId)
    throws RepositoryException {
  checkSessionInfo(sessionInfo);
  if (nodeId.getUniqueID() == null && nodeId.getPath().denotesRoot()) {
    synchronized (this) {
      if (rootNodeDefinition == null) {
        rootNodeDefinition = createRootNodeDefinition(sessionInfo);
      }
      return rootNodeDefinition;
    }
  }
  throw new UnsupportedRepositoryOperationException();
}
org.apache.jackrabbit.spiPathdenotesRoot

Javadoc

Tests whether this is the root path, i.e. "/".

Popular methods of Path

  • getElements
    Returns the elements of this path.
  • getLength
    Returns the length of this path, i.e. the number of its elements. Note that the root element "/" cou
  • getName
    Returns the name of the last path element, or null for an identifier. The names of the special root,
  • getAncestor
    Normalizes this path and returns the ancestor path of the specified relative degree. An ancestor of
  • getNormalizedIndex
    Returns the normalized index of the last path element. The normalized index of an element with an un
  • isAbsolute
    Tests whether this path is absolute, i.e. whether it starts with "/" or is an identifier based path.
  • computeRelativePath
    Computes the relative path from this absolute path toother.
  • denotesCurrent
    Checks if the last path element is the current element (".").
  • denotesName
    Checks if the last path element is a named and optionally indexed element.
  • getDepth
    Returns the depth of this path. The depth reflects the absolute or relative hierarchy level this pat
  • getIndex
    Returns the index of the last path element, or #INDEX_UNDEFINEDif the index is not defined or not ap
  • getNormalizedPath
    Returns the normalized path representation of this path. If the path cannot be normalized (e.g. if a
  • getIndex,
  • getNormalizedPath,
  • isAncestorOf,
  • isCanonical,
  • denotesParent,
  • getAncestorCount,
  • getCanonicalPath,
  • getLastElement,
  • getNameElement

Popular classes and methods

  • addToBackStack (FragmentTransaction)
  • getContentResolver (Context)
  • getSupportFragmentManager (FragmentActivity)
  • Window (java.awt)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
  • JTable (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble

For IntelliJ IDEA and
Android Studio

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)