public static DocPath fromPathString(final String pathString) {
        if (pathString == null || pathString.isEmpty()) {
            return EMPTY_INSTANCE;
        } else {
            String str = pathString.trim();
            final boolean absolute = str.startsWith(DELIMITER);
            if (absolute) {
                str = str.substring(1);
            }
            if (str.endsWith(DELIMITER)) {
                str = str.substring(0, str.length() - 1);
            }

            // Can't user Pattern.split cos of GWT :-(
            return DocPath.fromParts(absolute, str.split(DELIMITER_REGEX));
        }
    }
Construct a {@link DocPath} from a path string, e.g. {@code /foo/bar}.
A leading {@code /} means the path is absolute. Any trailing {@code /}
will be stripped.
stroom-util-shared/src/main/java/stroom/util/shared/DocPath.java