Given a full path, return the the individual parts, without slashes.
The root path will return an empty list.

@param path the path
@return an array of parts
964938
public static List<String> split(String path)
    {
        PathUtils.validatePath(path);
        return PATH_SPLITTER.splitToList(path);
    }
1022910
public String getLastPathSegment() {
        if (StringUtils.isBlank(path)) {
            return StringUtils.EMPTY;
        }
        String segment = path;
        segment = StringUtils.substringAfterLast(segment, "/");
        return segment;
    }
915690
public List<String> lsFiles(String path) {
		return ls(path, new Filter<LsEntry>() {
			@Override
			public boolean accept(LsEntry t) {
				return false == t.getAttrs().isDir();
			}
		});
	}
1324590
def split(path)
      parts = []
      last_index = 0
      while index = path.index("/", last_index)
        if index == last_index
          parts << ""
        else
          parts << path[last_index...index]
        end
        last_index = index + 1
      end
      # and also get that last segment
      parts << path[last_index..-1]
      # it should begin with a blank segment from the leading "/"; kill that
      parts.shift
      parts
    end
605793
function getPathParts(path) {
  // split the path specified into an array on `.`
  const pathParts = String(path).split('.');

  // create an empty array which will be the result
  const parts = [];

  // create an index variable so we can skip indexes if
  // need be when parsing the paths
  let index = 0;

  // while the index is smaller then the parts array length
  while (index < pathParts.length) {
    // get the part from the parts array
    let parsedPart = pathParts[index];

    // while (if) the part starts with `\` remove it and
    // append `.` and then next part from the array to it
    // this should result in `test\\.test` being parsed
    // into `test.test`. This is done so users can escape
    // dots from the dot notation
    while (parsedPart[parsedPart.length - 1] === '\\'
          && pathParts[index + 1] !== undefined
          && pathParts[index + 1] !== null) {
      // remove `\` and append the `.`
      parsedPart = `${parsedPart.slice(0, -1)}.`;
      // increase the index so next iteration it will skip
      // the next path which is about to be added to this path
      index += 1;
      // add the next path to the current one because they are
      // apart of the same object key
      parsedPart += pathParts[index];
    }

    // increase the index so we can continue to the next path
    // in the array
    index += 1;

    // append the parsed path to the results array
    parts.push(parsedPart);
  }

  // return all the parsed paths
  return parts;
}
1017532
protected function split($path)
  {
    if (is_array($path)) {
      $parts = $path;
    } else {
      $parts = explode("/", $path);
    }
    return $parts;
  }
351557
private static URL[] pathToURLs(String path) {
        java.util.List<URL> urls = new ArrayList<>();
        for (String s: path.split(Pattern.quote(File.pathSeparator))) {
            if (!s.isEmpty()) {
                URL url = fileToURL(Paths.get(s));
                if (url != null) {
                    urls.add(url);
                }
            }
        }
        return urls.toArray(new URL[urls.size()]);
    }
868058
function(path) {
      var t = this;

      // Get the parts
      var parts = Array.isArray(path) ? path : path.split('/').filter(function(item){return item;});

      // Return the item at this level
      if (parts.length === 1) {
        return t.get('leaves').get(parts[0]);
      }

      // Return the item from the tree below
      var sub = t.get('branches').get(parts[0]);
      if (sub) {
        return sub.getByPath(parts.slice(1));
      }

      // Branch not found
      return null;
    }
128945
public static List<String> tokenize_path(String path) {
        String[] toks = path.split(SEPERATOR);
        ArrayList<String> rtn = new ArrayList<String>();
        for (String str : toks) {
            if (!str.isEmpty()) {
                rtn.add(str);
            }
        }
        return rtn;
    }
70178
private static List<String> getAllPathAncestors(final String path) {
        final List<String> segments = asList(path.split("/"));
        return range(1, segments.size())
                .mapToObj(frameSize -> FEDORA_INTERNAL_PREFIX + "/" + String.join("/", segments.subList(1, frameSize)))
                .collect(toList());
    }
345559
public static List<ChildNumber> parsePath(@Nonnull String path) {
        String[] parsedNodes = path.replace("M", "").split("/");
        List<ChildNumber> nodes = new ArrayList<>();

        for (String n : parsedNodes) {
            n = n.replaceAll(" ", "");
            if (n.length() == 0) continue;
            boolean isHard = n.endsWith("H");
            if (isHard) n = n.substring(0, n.length() - 1);
            int nodeNumber = Integer.parseInt(n);
            nodes.add(new ChildNumber(nodeNumber, isHard));
        }

        return nodes;
    }
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;
	}
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;
	}
618530
def path_components(path):
    
    components = []
    # The loop guarantees that the returned components can be
    # os.path.joined with the path separator and point to the same
    # location:    
    while True:
        (new_path, tail) = os.path.split(path)  # Works on any platform
        components.append(tail)        
        if new_path == path:  # Root (including drive, on Windows) reached
            break
        path = new_path
    components.append(new_path)    
    components.reverse()  # First component first 
    return components
257517
public static String getFolderPath(final String path) {

		String cleanedPath = clean(path);

		if (cleanedPath != null && cleanedPath.contains(PATH_SEP)) {

			return PATH_SEP + StringUtils.substringBeforeLast(cleanedPath, PATH_SEP);

		} else {

			return PATH_SEP;

		}
	}
12295
function (path) {
            var result = path.match(splitPathRe) || [],
                root = result[1] || '',
                dir = result[2] || '';

            if (!root && !dir) {
                // No dirname
                return '.';
            }

            if (dir) {
                // It has a dirname, strip trailing slash
                dir = dir.substring(0, dir.length - 1);
            }

            return root + dir;
        }
366541
public function getPathParts($path)
    {
        $path = preg_replace('/\[/', '->[', $path);
        if (preg_match('/^->/', $path)) {
            $path = substr($path, 2);
        }

        return explode('->', $path);
    }