Iterate the root map down to the map specified by the passed path except
for the last element.

@param aPath
The path to iterate. May neither be <code>null</code> nor empty.
@return The map. May be <code>null</code> if the path did not find such a
child.
766215
@Nullable
  private ICommonsOrderedMap <String, RequestParamMapItem> _getChildMapExceptLast (@Nonnull @Nonempty final String... aPath)
  {
    ValueEnforcer.notEmpty (aPath, "Path");

    ICommonsOrderedMap <String, RequestParamMapItem> aMap = m_aMap;
    // Until the second last object
    for (int i = 0; i < aPath.length - 1; ++i)
    {
      aMap = _getChildMap (aMap, aPath[i]);
      if (aMap == null)
        return null;
    }
    return aMap;
  }
196435
public String getParentXPath() {
        Iterator<Level> levelIterator = path.descendingIterator();
        if (levelIterator.hasNext()) {
            levelIterator.next();
        }
        return getXPath(levelIterator);
    }
1215776
public DocumentPath childPath() {
    if (pathElements.size() <= 1) {
      return null;
    }
    return new DocumentPath(this.pathElements.subList(pathElements.size() - 1, pathElements.size()));
  }
361308
Multimap<Path, String> pathsToAttempt(Set<Location> protoLocations) {
    Multimap<Path, String> result = MultimapBuilder.linkedHashKeys().linkedHashSetValues().build();
    for (Location location : protoLocations) {
      pathsToAttempt(result, location);
    }
    return result;
  }
983430
B append(String path) {
    Preconditions.checkArgument(
        path != null && !path.isEmpty(), "'path' must be a non-empty String");
    ImmutableList.Builder<String> components = ImmutableList.builder();
    components.addAll(this.getSegments());
    components.add(splitChildPath(path));
    return createPathWithSegments(components.build());
  }
786332
public static Map dissoc(final Map map, final Object... path) {
        if (path == null || path.length == 0) {
            throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
        }
        if (path.length == 1) {
            map.remove(path[0]);
            return map;
        }
        final Object[] pathToLastNode = Arrays.copyOfRange(path, 0, path.length - 1);
        final Object lastKey = path[path.length - 1];
        Map<Object, Object> intermediateMap = map;
        for (Object key : pathToLastNode) {
            final Object node = intermediateMap.get(key);
            if (node != null) {
                final Optional<Map> nodeMapOption = ClassApi.cast(node, Map.class);
                if (nodeMapOption.isPresent()) {
                    intermediateMap = nodeMapOption.get();
                } else {
                    throw new IllegalAccessError("Node with key '" + key + "' is not a map!");
                }
            } else {
                return map;
            }
        }
        intermediateMap.remove(lastKey);
        return map;
    }
687105
public static <T> Optional<T> get(final Map map, final Class<T> clazz, final Object... path) {
        if (path == null || path.length == 0) {
            throw new IllegalArgumentException(PATH_MUST_BE_SPECIFIED);
        }
        if (path.length == 1) {
            return Optional.ofNullable((T) map.get(path[0]));
        }
        final Object[] pathToLastNode = Arrays.copyOfRange(path, 0, path.length - 1);
        final Object lastKey = path[path.length - 1];
        Map<Object, Object> intermediateMap = map;
        for (Object key : pathToLastNode) {
            final Object node = intermediateMap.get(key);
            if (node != null) {
                final Optional<Map> nodeMapOption = ClassApi.cast(node, Map.class);
                if (nodeMapOption.isPresent()) {
                    intermediateMap = nodeMapOption.get();
                } else {
                    throw new IllegalAccessError("Node with key '" + key + "' is not a map!");
                }
            } else {
                return Optional.empty();
            }
        }
        return Optional.ofNullable((T) intermediateMap.get(lastKey));
    }
769519
public static synchronized String getAbsolutePath(String path) {
		try {
			if (rootDir == null) {
				Class<?> parentClass = getParentClass();
				String classFile = parentClass.getName().replace('.', '/') + ".class";
				URL url = parentClass.getResource("/" + classFile);
				if (url == null) {
					return null;
				}
				if (url.getProtocol().equals("jar")) {
					rootDir = url.getPath();
					int i = rootDir.lastIndexOf('!');
					if (i >= 0) {
						rootDir = rootDir.substring(0, i);
					}
					rootDir = new File(new URL(rootDir).toURI()).getParent();
				} else {
					rootDir = new File(url.toURI()).getPath();
					rootDir = rootDir.substring(0, rootDir.length() - classFile.length());
					if (rootDir.endsWith(File.separator)) {
						rootDir = rootDir.substring(0, rootDir.length() - 1);
					}
				}
				rootDir = new File(rootDir).getParent();
			}
			return new File(rootDir + File.separator + path).getCanonicalPath();
		} catch (IOException | URISyntaxException e) {
			throw new RuntimeException(e);
		}
	}
1216178
@SuppressWarnings("unchecked")
	public TreeNode<T> findByPath(T... path) {
		return findByPath(Arrays.asList(path));
	}
656657
static String root(final ResourcePath path) {
        if (path.getDepth() == 1)
            return path.getResourcePath();
        throw new JaxRxException(404, "Resource not found: " + path);
    }
1053883
public Tree clear(String path) {
		Tree child = getChild(path, false);
		if (child == null) {
			child = putMap(path);
		} else {
			child.clear();
		}
		return child;
	}
1188948
public static List<String> parsePath(String pPath) {
        // Special cases which simply implies 'no path'
        if (pPath == null || pPath.equals("") || pPath.equals("/")) {
            return null;
        }
        return replaceWildcardsWithNull(split(pPath, PATH_ESCAPE, "/"));
    }
129963
public static String mapToPtPath(final String aBasePath, final String aID) {
        return concat(aBasePath, mapToPtPath(aID), null);
    }
663043
private boolean startsWithCustomRoot(String path) {
		for (Enumeration<String> it = customRoots.elements(); it != null
				&& it.hasMoreElements();) {
			if (path.startsWith(it.nextElement())) {
				return true;
			}
		}
		return false;
	}
450216
public ProtoFile protoFile(String path) {
    for (ProtoFile protoFile : protoFiles) {
      if (protoFile.location().getPath().equals(path)) {
        return protoFile;
      }
    }
    return null;
  }
109768
public PathElement getLastElement() {
        final List<PathElement> list = pathAddressList;
        return list.size() == 0 ? null : list.get(list.size() - 1);
    }
305426
public PathTemplate withoutVars() {
    StringBuilder result = new StringBuilder();
    ListIterator<Segment> iterator = segments.listIterator();
    boolean start = true;
    while (iterator.hasNext()) {
      Segment seg = iterator.next();
      switch (seg.kind()) {
        case BINDING:
        case END_BINDING:
          break;
        default:
          if (!start) {
            result.append(seg.separator());
          } else {
            start = false;
          }
          result.append(seg.value());
      }
    }
    return create(result.toString(), urlEncoding);
  }