Utility method used to convert a path into its effective segments.
@param path Path to be interpreted
@return List of path fragments
@throws Exception On invalid parameters
199215
static public List<String> interpretPath(String path) throws Exception {
		if( null == path ) {
			throw new Exception("path parameter should not be null");
		}
		if( path.codePointAt(0) == '/' ) {
			throw new Exception("absolute path is not acceptable");
		}

		// Verify path
		List<String> pathFragments = new Vector<String>();
		{
			String[] pathFrags = path.split("/");
			for(String pathFrag : pathFrags){
				if( ".".equals(pathFrag) ){
					// ignore
				} else if( "..".equals(pathFrag) ){
					throw new Exception("Parent references (..) not allowed");
				} else if( "".equals(pathFrag) ){
					// ignore
				} else {
					pathFragments.add(pathFrag);
				}
			}
		}
		
		return pathFragments;
	}
1144274
B append(BasePath<B> path) {
    ImmutableList.Builder<String> components = ImmutableList.builder();
    components.addAll(this.getSegments());
    components.addAll(path.getSegments());
    return createPathWithSegments(components.build());
  }
93502
public void addPath(String path) {
        if (path == null) {
            return;
        }
        String[] pathComponents = path.split("/");
        TrieNode parent = rootNode;
        String part = null;
        if (pathComponents.length <= 1) {
            throw new IllegalArgumentException("Invalid path " + path);
        }
        for (int i=1; i<pathComponents.length; i++) {
            part = pathComponents[i];
            if (parent.getChild(part) == null) {
                parent.addChild(part, new TrieNode(parent));
            }
            parent = parent.getChild(part);
        }
        parent.setProperty(true);
    }
948723
public String []list(String path) throws IOException
  {
    if (path.startsWith("/")) {
      path = path.substring(1);
    }
    
    if (! path.endsWith("/")) {
      path = path + "/";
    }

    ArrayList<String> names = new ArrayList<>();
    
    ZipFile zipFile = getZipFile();
    
    try {
      Enumeration<? extends ZipEntry> e = zipFile.entries();
      
      while (e.hasMoreElements()) {
        ZipEntry entry = e.nextElement();
        
        String name = entry.getName();

        if (name.startsWith(path)) {
          String tail = name.substring(path.length());
          int p = tail.indexOf('/');
          
          if (p >= 0) {
            tail = tail.substring(0, p);
          }
          
          if (! tail.equals("") && ! names.contains(tail)) {
            names.add(tail);
          }
        }
      }
    } finally {
      closeZipFile(zipFile);
    }
    
    String []list = new String[names.size()];
    
    names.toArray(list);
    
    return list;
  }
413336
public static String formatPath(List<ChildNumber> path) {
        return PATH_JOINER.join(Iterables.concat(Collections.singleton("M"), path));
    }
982617
static List<MethodParameter> extract(String path) {

		List<MethodParameter> output = new ArrayList<>();

		List<String> items = split(path);

		if (items.size() > 0) {

			int pathIndex = 0;
			int index = 0;
			for (String item : items) {

				MethodParameter param = getParamFromPath(item, index, pathIndex); // set negative index until confirmed that needed

				if (param != null) {
					output.add(param);
					index++;
				}

				pathIndex++;
			}
		}

		return output;
	}
1001323
public static JavaRDD<String> listPaths(JavaSparkContext sc, String path) throws IOException {
        return listPaths(sc, path, false);
    }
965780
private String[] splitPath(String path) {

        path = path.replaceAll("^/", "").replaceAll("/$", "");
        return path.split("/");
    }
800443
public static File[] ls(String path) {
		if (path == null) {
			return null;
		}

		path = getAbsolutePath(path);

		File file = file(path);
		if (file.isDirectory()) {
			return file.listFiles();
		}
		throw new IORuntimeException(StrUtil.format("Path [{}] is not directory!", path));
	}
228007
private Path[] listPaths(final Path path)
      throws IOException {
    Path[] children = null;
    ArrayList<Path> tmpChildrenPath = new ArrayList<>();
    if (fs.isDirectory(path)) {
      // Get children's path list.
      FileStatus[] chiledrenFileStatus = pathFilter == null ? fs.listStatus(path) : fs.listStatus(path, pathFilter);
      for (FileStatus childFileStatus : chiledrenFileStatus) {
        tmpChildrenPath.add(childFileStatus.getPath());
      }
      children = tmpChildrenPath.toArray(new Path[tmpChildrenPath.size()]);
    }
    if (children == null) {
      children = EMPTY_PATH_ARRAY;
    }
    if (comparator != null && children.length > 1) {
      Arrays.sort(children, comparator);
    }
    return children;
  }
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, "/"));
    }
1252109
public Stream<URL> getResources(String path) {
        Enumeration<URL> all;
        try {
            all = classLoader.getResources(prefixPath(path));
        } catch (IOException e) {
            return Stream.empty();
        }
        Stream.Builder<URL> builder = Stream.builder();
        while (all.hasMoreElements()) {
            URL url = all.nextElement();
            builder.accept(url);
        }
        return builder.build();
    }
605663
public List<V> getDescendantValues(List<P> path) {

        CmsPathTree<P, V> node = findNode(path);
        List<V> result = Lists.newArrayList();
        if (node != null) {
            node.collectEntries(result);
        }
        return result;
    }
675979
public static String trimLastPathSection(String path) {
        String[] sections = path.split("/");
        StringBuilder newPath = new StringBuilder("/");
        for (int i = 1; i < sections.length - 1; i++) {
            newPath.append(sections[i]).append("/");
        }
        return newPath.toString();
    }
330695
public List<String> getMultiSelect(String path) {
        List<String> values = new ArrayList<String>();
        for (JsonValue val : this.getValue(path).asArray()) {
            values.add(val.asString());
        }

        return values;
    }
1054858
public static String applyFromPath(String path) throws ConverterException {		
		String xml = converters.get(0).convertFromPath(path, false);						
		xml = applyFromSecond(xml);
		if (conversionDone()) {
			return converters.get(converters.size()-1).changeVersion(xml);
		} else {
			return xml;
		}
	}
586639
public static ArrayList<File> getDirectoriesInDirectoryTree(String path) {
		File file = new File(path);
		return getContentsInDirectoryTree(file, "*", false, true);
	}