Examples of PathNotFoundException


Examples of org.apache.hadoop.fs.PathNotFoundException

    }

    @Override
    protected void processNonexistentPath(PathData item) throws IOException {
      if (!item.parentExists()) {
        throw new PathNotFoundException(item.toString());
      }
      touchz(item);
    }
View Full Code Here

Examples of org.apache.hadoop.fs.PathNotFoundException

  @Override
  protected void processNonexistentPath(PathData item) throws IOException {
    // check if parent exists. this is complicated because getParent(a/b/c/) returns a/b/c, but
    // we want a/b
    if (!item.fs.exists(new Path(item.path.toString()).getParent()) && !createParents) {
      throw new PathNotFoundException(item.toString());
    }
    if (!item.fs.mkdirs(item.path)) {
      throw new PathIOException(item.toString());
    }
  }
View Full Code Here

Examples of org.apache.hadoop.fs.shell.PathExceptions.PathNotFoundException

   */
  protected List<PathData> expandArgument(String arg) throws IOException {
    PathData[] items = PathData.expandAsGlob(arg, getConf());
    if (items.length == 0) {
      // it's a glob that failed to match
      throw new PathNotFoundException(arg);
    }
    return Arrays.asList(items);
  }
View Full Code Here

Examples of org.jboss.dna.graph.properties.PathNotFoundException

            if (!(error instanceof PathNotFoundException)) return fromCache;

            // The path was not found in the cache, so since we don't know whether the ancestors are federated
            // from multiple source nodes, we need to populate the cache starting with the lowest ancestor
            // that already exists in the cache.
            PathNotFoundException notFound = (PathNotFoundException)fromCache.getError();
            Path lowestExistingAncestor = notFound.getLowestAncestorThatDoesExist();
            Path ancestor = path.getParent();

            if (!ancestor.equals(lowestExistingAncestor)) {
                // Load the nodes along the path below the existing ancestor, down to (but excluding) the desired path
                Path pathToLoad = path.getParent();
                while (!pathToLoad.equals(lowestExistingAncestor)) {
                    loadContributionsFromSources(pathToLoad, null, contributions); // sourceNames may be null or empty
                    FederatedNode mergedNode = createFederatedNode(null, pathToLoad, contributions, true);
                    if (mergedNode == null) {
                        // No source had a contribution ...
                        I18n msg = FederationI18n.nodeDoesNotExistAtPath;
                        fromCache.setError(new PathNotFoundException(path, ancestor, msg.text(path, ancestor)));
                        return fromCache;
                    }
                    contributions.clear();
                    // Move to the next child along the path ...
                    pathToLoad = pathToLoad.getParent();
                }
            }
            // At this point, all ancestors exist ...
        } else {
            // There is no error, so look for the merge plan ...
            MergePlan mergePlan = getMergePlan(fromCache);
            if (mergePlan != null) {
                // We found the merge plan, so check whether it's still valid ...
                final DateTime now = getCurrentTimeInUtc();
                if (mergePlan.isExpired(now)) {
                    // It is still valid, so check whether any contribution is from a non-existant projection ...
                    for (Contribution contribution : mergePlan) {
                        if (!this.sourceNames.contains(contribution.getSourceName())) {
                            // TODO: Record that the cached contribution is from a source that is no longer in this repository
                        }
                    }
                    return fromCache;
                }

                // At least one of the contributions is expired, so go through the contributions and place
                // the valid contributions in the 'contributions' list; any expired contribution
                // needs to be loaded by adding the name to the 'sourceNames'
                if (mergePlan.getContributionCount() > 0) {
                    sourceNames = new HashSet<String>(sourceNames);
                    for (Contribution contribution : mergePlan) {
                        if (!contribution.isExpired(now)) {
                            sourceNames.remove(contribution.getSourceName());
                            contributions.add(contribution);
                        }
                    }
                }
            }
        }

        // Get the contributions from the sources given their names ...
        loadContributionsFromSources(path, sourceNames, contributions); // sourceNames may be null or empty
        FederatedNode mergedNode = createFederatedNode(fromCache, path, contributions, true);
        if (mergedNode == null) {
            // No source had a contribution ...
            Path ancestor = path.getParent();
            I18n msg = FederationI18n.nodeDoesNotExistAtPath;
            fromCache.setError(new PathNotFoundException(path, ancestor, msg.text(path, ancestor)));
            return fromCache;
        }
        return mergedNode;
    }
View Full Code Here

Examples of org.jboss.dna.graph.property.PathNotFoundException

        try {

            kind = repos.checkPath(myPath, -1);
            if (kind == SVNNodeKind.NONE) {
                // node does not exist or requested node is not correct.
                throw new PathNotFoundException(Location.create(requestedPath), null,
                                                SVNRepositoryConnectorI18n.nodeDoesNotExist.text(myPath));
            } else if (kind == SVNNodeKind.UNKNOWN) {
                // node is unknown
                throw new PathNotFoundException(Location.create(requestedPath), null,
                                                SVNRepositoryConnectorI18n.nodeIsActuallyUnknow.text(myPath));
            }
        } catch (SVNException e) {
            throw new RepositorySourceException(
                                                getSourceName(),
View Full Code Here

Examples of org.modeshape.jcr.cache.PathNotFoundException

            CachedNode node = rootNode();
            for (Segment segment : path) {
                ChildReferences children = node.getChildReferences(cache);
                ChildReference child = children.getChild(segment);
                if (child == null) {
                    throw new PathNotFoundException(path, node.getKey(), node.getPath(cache));
                }
                NodeKey childKey = child.getKey();
                CachedNode childNode = cache.getNode(childKey);
                if (childNode == null) {
                    throw new PathNotFoundException(path, node.getKey(), node.getPath(cache));
                }
                node = childNode;
            }
            assertThat(node, is(notNullValue()));
            return node;
View Full Code Here

Examples of org.opentripplanner.routing.error.PathNotFoundException

        }
        options.rctx.debugOutput.finishedCalculating();

        if (paths == null || paths.size() == 0) {
            LOG.info("Path not found: " + options.from + " : " + options.to);
            throw new PathNotFoundException();
        }

        for (GraphPath graphPath : paths) {
            if (originalOptions.arriveBy) {
                if (graphPath.states.getLast().getTimeSeconds() > originalOptions.dateTime) {
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.