MCPcopy Create free account
hub / github.com/BaseXdb/basex / isValid

Method isValid

basex-core/src/main/java/org/basex/io/IOFile.java:461–466  ·  view source on GitHub ↗

Checks if the specified string is a valid file reference. @param path path string @return result of check

(final String path)

Source from the content-addressed store, hash-verified

459 * @return result of check
460 */
461 public static boolean isValid(final String path) {
462 // check if path starts with Windows drive letter
463 final int c = path.indexOf(':');
464 return c == -1 || !Prop.WIN || c == 1 && Token.letter(path.charAt(0)) &&
465 (path.indexOf('/') == 2 || path.indexOf('\\') == 2);
466 }
467
468 /**
469 * Converts a name filter (glob) to a regular expression.

Callers 2

getMethod · 0.95
errorMethod · 0.45

Calls 3

letterMethod · 0.95
charAtMethod · 0.80
indexOfMethod · 0.45

Tested by

no test coverage detected