Check if a path has a segment prefixed with fedora:

@param externalPath the path.
175288
protected static void hasRestrictedPath(final String externalPath) {
        final String[] pathSegments = externalPath.split("/");
        if (Arrays.stream(pathSegments).anyMatch(p -> p.startsWith("fedora:"))) {
            throw new ServerManagedTypeException("Path cannot contain a fedora: prefixed segment.");
        }
    }
463134
private static boolean validateBeanPath(final CharSequence path) {
        final int pathLen = path.length();
        boolean inKey = false;
        for (int charPos = 0; charPos < pathLen; charPos++) {
            final char c = path.charAt(charPos);
            if (!inKey && c == PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR) {
                inKey = true;
            }
            else if (inKey && c == PropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR) {
                inKey = false;
            }
            else if (!inKey && !Character.isJavaIdentifierPart(c) && c != '.') {
                return false;
            }
        }
        return true;
    }
1341687
boolean matches(final String path) {

        logger.debug("path to match: {}", path);

        if (excludedPaths.contains(path)) {
            return false;
        }

        for (Pattern pattern : excludedPatterns) {
            if (pattern.matcher(path).matches()) {
                return false;
            }
        }

        return true;
    }
184011
public boolean containsProgramPath(String path) {
        return registryMap.containsKey(path) && registryMap.get(path).getProgram() != null;
    }
800420
public static boolean isAbsolutePath (final String path) {
        if (path == null || path.trim().length() == 0) {
            return false;
        }

        if (File.separator.equals(UNIX_SEPARATOR)) {
            return path.startsWith(UNIX_SEPARATOR);
        } else

        if (File.separator.equals(WINDOWS_SEPARATOR) && path.length() > 2) {
            return path.matches("([a-zA-Z]:|\\\\)\\\\.*");
        }

        return false;
    }
998003
protected function isExternal(string $path): bool
    {
        foreach ($this->schemes as $scheme) {
            if (strpos($path, $scheme) !== false) {
                return true;
            }
        }

        return false;
    }
398014
private String translatePathExternal(String intpath) {
        if (fullPath) {
            return intpath;
        } else {
            return PathUtil.appendPath(rootPath.getPath(), intpath);
        }
    }
62998
public static boolean checkIsPathOrLinkToSvg(String path) {

        if (path == null) {
            return false;
        }
        path = path.trim().toLowerCase();
        int paramPos = path.indexOf("?");
        if (paramPos >= 0) {
            path = path.substring(0, paramPos);
        }
        return path.endsWith(".svg");
    }
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);
    }
1361767
boolean isSpecialPath(String path) {
        if (rootZookeeper.equals(path) || procZookeeper.equals(path)
                || quotaZookeeper.equals(path)) {
            return true;
        }
        return false;
    }
513103
@Override
	public boolean matchPath(String path) {

		boolean match = false;
		if (StringUtils.isNotEmpty(path)) {
			match = path.endsWith(suffix);
		}
		return match;
	}
1178300
private boolean hasBinaryFileExtension(String path) {
		boolean result = false;

		int extFileIdx = path.lastIndexOf(".");
		if (extFileIdx != -1 && extFileIdx + 1 < path.length()) {
			String extension = path.substring(extFileIdx + 1);
			result = binaryMimeTypeMap.containsKey(extension);
		}

		return result;
	}
734825
public boolean isTemporaryPath(String path) {
    for (String tempPath : tempIdentifiers) {
      String[] tempPathComponents = tempPath.split("/");
      if (tempPathComponents.length > 0
          && path != null && path.contains(tempPathComponents[0].replace("ID", ""))) {
        return true;
      }
    }
    return false;
  }
10397
public static  String convertToExternalPath(final String path) {
        String newPath = replaceOnce(path, "/" + CONTAINER_WEBAC_ACL, "/" + FCR_ACL);

        newPath = replaceOnce(newPath, "/" + LDPCV_TIME_MAP, "/" + FCR_VERSIONS);

        newPath = replaceOnce(newPath, "/" + FEDORA_DESCRIPTION, "/" + FCR_METADATA);

        return newPath;
    }
92215
public static List<ExternalEvent> getPathExternalEvents(String bucket){
        if (myPathCache.get(bucket) != null)
            return myPathCache.get(bucket);
        else if (bucket.indexOf('/') > 0) {  // We could have a sub-path
            return getPathExternalEvents(bucket.substring(0, bucket.lastIndexOf('/')));
        }
        return null;
    }
932959
public static ExternalSessionKey fromWebDriverRequest(String path) {
      int sessionIndex = path.indexOf("/session/");
      if (sessionIndex != -1) {
        sessionIndex += "/session/".length();
        int nextSlash = path.indexOf("/", sessionIndex);
        String session;
        if (nextSlash != -1) {
          session = path.substring(sessionIndex, nextSlash);
        } else {
          session = path.substring(sessionIndex, path.length());
        }
        if ("".equals(session)) {
          return null;
        }
        return new ExternalSessionKey(session);
      }
      return null;
  }
229876
public static boolean isGrailsPath(String path) {
        if(KNOWN_PATHS.containsKey(path)) {
            return KNOWN_PATHS.get(path);
        }
        for (Pattern grailsAppResourcePattern : grailsAppResourcePatterns) {
            Matcher m = grailsAppResourcePattern.matcher(path);
            if (m.find()) {
                KNOWN_PATHS.put(path, true);
                return true;
            }
        }
        KNOWN_PATHS.put(path, false);
        return false;
    }