{@inheritDoc}

@see java.nio.file.Path#startsWith(java.nio.file.Path)
352611
@Override
    public boolean startsWith(final Path other) {
        // Precondition checks
        if (other == null) {
            throw new IllegalArgumentException("other path must be specified");
        }
        // Unequal FS
        if (this.getFileSystem() != other.getFileSystem()) {
            return false;
        }

        // Tokenize each
        final List<String> ourTokens = tokenize(this);
        final List<String> otherTokens = tokenize((ShrinkWrapPath) other);

        // Inequal roots
        if (other.isAbsolute() && !this.isAbsolute()) {
            return false;
        }

        // More names in the other Path than we have
        final int otherTokensSize = otherTokens.size();
        if (otherTokensSize > ourTokens.size()) {
            return false;
        }

        // Ensure each of the other name elements match ours
        for (int i = 0; i < otherTokensSize; i++) {
            if (!otherTokens.get(i).equals(ourTokens.get(i))) {
                return false;
            }
        }

        // All conditions met
        return true;
    }
1018541
public static final boolean startsWith(char[] array, char[] toBeFound)
	{
		int i = toBeFound.length;
		if (array.length < i)
		{
			return false;
		}
		while (--i >= 0)
		{
			if (toBeFound[i] != array[i])
			{
				return false;
			}
		}
		return true;
	}
772247
@Override
    public Path subpath(final int beginIndex, final int endIndex) {
        if (beginIndex < 0) {
            throw new IllegalArgumentException("Begin index must be greater than 0");
        }
        if (endIndex < 0) {
            throw new IllegalArgumentException("End index must be greater than 0");
        }
        if (endIndex <= beginIndex) {
            throw new IllegalArgumentException("End index must be greater than begin index");
        }
        final List<String> tokens = tokenize(this);
        final int tokenCount = tokens.size();
        if (beginIndex >= tokenCount) {
            throw new IllegalArgumentException("Invalid begin index " + endIndex + " for " + this.toString()
                + "; must be between 0 and " + tokenCount + " exclusive");
        }
        if (endIndex > tokenCount) {
            throw new IllegalArgumentException("Invalid end index " + endIndex + " for " + this.toString()
                + "; must be between 0 and " + tokenCount + " inclusive");
        }
        final StringBuilder newPathBuilder = new StringBuilder();
        for (int i = 0; i < endIndex; i++) {
            newPathBuilder.append(ArchivePath.SEPARATOR);
            newPathBuilder.append(tokens.get(i));
        }
        final Path newPath = this.fromString(newPathBuilder.toString());
        return newPath;
    }
1303822
public boolean startsWith(final Bits key) {
    if (key.bitLength > this.bitLength) {
      return false;
    }
    final Bits prefix = key.bitLength < this.bitLength ? this.range(0,
      key.bitLength) : this;
    return prefix.compareTo(key) == 0;
  }
68899
@ConfigArg(0)
  public void setPath(PathImpl path)
  {
    if (path.getPath().endsWith(".jar")
        || path.getPath().endsWith(".zip")) {
      path = JarPath.create(path);
    }

    _path = path;
  }
747822
function startsWithAny(string, vector) {
  return _.any(vector.map(function (e) { return _str.startsWith(string, e); }));
}
252044
protected boolean match(final String path) {

        final String methodName = "match";

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, methodName, this, path, ignoreCase, wildcard);
        }

        if (this.matcher == null) {
            if (ignoreCase) {
                if (pattern.equalsIgnoreCase(path)) {
                    return true;
                }
                if (wildcard && path.toLowerCase().startsWith(pattern)) {
                    return true;
                }
            } else {
                if (pattern.equals(path)) {
                    return true;
                }
                if (wildcard && path.startsWith(pattern)) {
                    return true;
                }
            }
        } else {
            return this.matcher.matcher(path).matches();
        }

        return false;
    }
65590
static String canonicalPath(String path) {
        List<String> r = new ArrayList<String>(Arrays.asList(path.split("/+")));
        for (int i=0; i<r.size(); ) {
            if (r.get(i).length()==0 || r.get(i).equals(".")) {
                // empty token occurs for example, "".split("/+") is [""]
                r.remove(i);
            } else
            if (r.get(i).equals("..")) {
                // i==0 means this is a broken URI.
                r.remove(i);
                if (i>0) {
                    r.remove(i-1);
                    i--;
                }
            } else {
                i++;
            }
        }

        StringBuilder buf = new StringBuilder();
        if (path.startsWith("/"))
            buf.append('/');
        boolean first = true;
        for (String token : r) {
            if (!first)     buf.append('/');
            else            first = false;
            buf.append(token);
        }
        // translation: if (path.endsWith("/") && !buf.endsWith("/"))
        if (path.endsWith("/") && (buf.length()==0 || buf.charAt(buf.length()-1)!='/'))
            buf.append('/');
        return buf.toString();
    }
455506
public static boolean startsWith(String str, char prefix) {
	return str != null && str.length() > 0 && str.charAt(0) == prefix;
    }
478315
public static boolean hasRoot(String path, String root) {
        String p = cleanPath(path);
        String r = cleanPath(root);
        return p.equals(r)
               || r.equals(cleanPath(ROOT.getPath()))
               || p.startsWith(r + SEPARATOR);
    }
996616
public boolean endsWith(UnixPath other) {
    UnixPath me = removeTrailingSeparator();
    other = other.removeTrailingSeparator();
    if (other.path.length() > me.path.length()) {
      return false;
    } else if (!me.path.isEmpty() && other.path.isEmpty()) {
      return false;
    } else if (other.isAbsolute()) {
      return me.isAbsolute() && me.path.equals(other.path);
    }
    return startsWith(me.splitReverse(), other.splitReverse());
  }
81307
public UrlBuilder withPath(String path) {
        if (path == null || path.isEmpty()) {
            this.path = null;
        } else {
            with(path, UrlTokenizerState.PATH);
        }
        return this;
    }
1240986
public static boolean startsWith(CharSequence seq, CharSequence pattern, IntUnaryOperator op)
    {
        if (pattern.length() > seq.length())
        {
            return false;
        }
        int length = pattern.length();
        for (int ii=0;ii<length;ii++)
        {
            if (op.applyAsInt(seq.charAt(ii)) != op.applyAsInt(pattern.charAt(ii)))
            {
                return false;
            }
        }
        return true;
    }
421219
public void setPath(String p){

		path = p ;

		if ( ! (path.endsWith(fileSeparator) ) )
			path = path + fileSeparator;

	}
513103
@Override
	public boolean matchPath(String path) {

		boolean match = false;
		if (StringUtils.isNotEmpty(path)) {
			match = path.endsWith(suffix);
		}
		return match;
	}
108139
String withPath(String[] path) {
        StringBuilder sb = new StringBuilder();
        if (path.length > 0) {
            sb.append(" (with path ");
            for (int i = 0; i < path.length - 1; i++) {
                sb.append(path[i]);
                sb.append(".");
            }
            sb.append(path[path.length - 1]);
            sb.append(") ");
        }
        return sb.toString();

    }
1049841
public static boolean startsWith(String value, String... prefixes) {
        if (isNotEmpty(value) && isNotEmpty(prefixes)) {
            for (String prefix : prefixes) {
                if (value.startsWith(prefix)) {
                    return true;
                }
            }
        }
        return false;
    }