Splits a path into components.<p>

@param path the path to split
@return the path components
965780
private String[] splitPath(String path) {

        path = path.replaceAll("^/", "").replaceAll("/$", "");
        return path.split("/");
    }
870234
def split_path(path):
    
    parts = []
    path, tail = os.path.split(path)
    while path and tail:
        parts.append(tail)
        path, tail = os.path.split(path)
    parts.append(os.path.join(path, tail))
    return map(os.path.normpath, parts)[::-1]
816515
public static String pathOnly(String path)
   {
      String curPath = path;
      curPath = curPath.substring(curPath.indexOf("/"));
      curPath = curPath.substring(0, curPath.lastIndexOf("/"));
      if ("".equals(curPath))
      {
         curPath = "/";
      }
      return curPath;
   }
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;
    }
1182221
private function splitPath($path)
    {
        // init
        $textDelimiter = '\'';
        $pathDelimiter = '.';
        $result = array();

        // action
        $stringIsOpen = false;
        $currentChunk = '';
        for ($i = 0; $i < strlen($path); $i++) {
            $currentSymbol = $path[$i];

            if ($currentSymbol == $textDelimiter) {
                $stringIsOpen = !$stringIsOpen;
            }

            if ($currentSymbol == $pathDelimiter && !$stringIsOpen) {
                $result[count($result)] = $currentChunk;
                $currentChunk = '';
                continue;
            }
            $currentChunk .= $currentSymbol;
        }

        $result[count($result)] = $currentChunk;

        // return
        return $result;
    }
1214319
public static String dirpart(final String path) {
        int s = path.lastIndexOf(File.separatorChar);
        if (s != -1) {
            return path.substring(0, s);
        } else {
            return null;
        } 
    }
558143
static String[] getPathNames(String path) {
    if (path == null || !path.startsWith(Path.SEPARATOR)) {
      return null;
    }
    return StringUtils.split(path, Path.SEPARATOR_CHAR);
  }
818334
def path_to_parts(path)
      path.
        downcase.
        split('/').
        map { |part| part.empty? ? nil : part.strip }.
        compact
    end
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
299020
public CmsSitemapTreeItem getTreeItem(String path) {

        CmsSitemapData data = m_controller.getData();
        CmsClientSitemapEntry root = data.getRoot();
        String rootSitePath = root.getSitePath();
        String remainingPath = path.substring(rootSitePath.length());

        CmsSitemapTreeItem result = getRootItem();

        String[] names = CmsStringUtil.splitAsArray(remainingPath, "/");
        for (String name : names) {
            if (CmsStringUtil.isEmptyOrWhitespaceOnly(name)) {
                continue;
            }
            result = (CmsSitemapTreeItem)result.getChild(name);
            if (result == null) {
                return null;
            }
        }
        return result;

    }
397614
public static @NonNull String[] splitPath(String path) {
		@NonNull String[] split = new @NonNull String[] { "", "", "" };
		int baseIndex = Math.max(path.lastIndexOf('/'), path.lastIndexOf('\\'));
		String fileName;

		if (baseIndex > 0) {
			split[0] = path.substring(0, baseIndex);
			fileName = path.substring(baseIndex + 1);
		} else if (baseIndex == 0) {
			split[0] = path.substring(0, baseIndex + 1);
			fileName = path.substring(baseIndex + 1);
		} else {
			fileName = path;
		}

		int extIndex = fileName.lastIndexOf('.');

		if (extIndex > 0) {
			split[1] = fileName.substring(0, extIndex);
			split[2] = fileName.substring(extIndex + 1);
		} else {
			split[1] = fileName;
		}
		return split;
	}
47163
public static Path<?> getPath(Path<?> path, String propertyPath) {
        if (StringUtils.isEmpty(propertyPath)) return path;

        String name = StringUtils.substringBefore(propertyPath, PropertyUtils.PROPERTY_SEPARATOR);
        Path<?> p = path.get(name);

        return getPath(p, StringUtils.substringAfter(propertyPath, PropertyUtils.PROPERTY_SEPARATOR));

    }
268798
public CmsRelationFilter filterPath(String path) {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        filter.m_path = path;
        return filter;
    }
117853
public static String getResource(final String path) {
		final InputStream stream = getResourceStream(path);
		final BufferedReader reader = new BufferedReader(new InputStreamReader(stream));
		final Stream<String> lines = reader.lines();
		return lines.collect(Collectors.joining("\n"));
	}
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;
    }
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());
  }
1296579
public JCRPath parseJCRPath(String path) throws RepositoryException
   {
      if (isAbsPathParseable(path))
      {
         return parseAbsPath(path);
      }
      else
      {
         return parseRelPath(path);
      }
   }