boolean (@NotNull String path, @NotNull String remotePrefix) { path = norm(path); remotePrefix = norm(remotePrefix); return path.startsWith(remotePrefix) && (path.length() == remotePrefix.length() || remotePrefix.endsWith("/") || path.substring(remotePrefix.length()).startsWith("/")); }