code: public static ParsedPath toEntry(String rawPath) {
          final String path = rawPath.trim();
  
          final boolean startsWithDelimiter = path.startsWith("/");
  
          // Keep the trailing delimiter.
          // This allows us to treat paths that end with a delimiter differently from paths that don't.
          // i.e. path/to would be a path with 2 elements: 'path' and 'to', but
          // but  path/to/ would be a path with 3 elements: 'path', 'to' and an empty element ''.
          final List<String> pathElements = splitPath(path, true);
          return new ParsedPath(startsWithDelimiter, pathElements);
      }
docs: Create a path that is expected to represent a path to any entry.
  This is different from {@link #toDirectory(String)} in that if the path ends with a delimiter '/',
  it is <b>not</b> considered the same as if it didn't.
  i.e. path/to would be a path with 2 elements: 'path' and 'to', but
  but  path/to/ would be a path with 3 elements: 'path', 'to' and an empty element ''.
  
  @param rawPath Path to parse.
  @return A {@link ParsedPath} out of the given path.
  @throws IllegalArgumentException If any element along the path except the last one is empty.