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

Method checkSuffix

basex-core/src/main/java/org/basex/io/IO.java:353–361  ·  view source on GitHub ↗

Tests if the file suffix of a path matches the specified suffixes. @param path path @param suffixes suffixes to compare with @return result of check

(final String path, final String... suffixes)

Source from the content-addressed store, hash-verified

351 * @return result of check
352 */
353 public static boolean checkSuffix(final String path, final String... suffixes) {
354 final int i = path.lastIndexOf('.');
355 if(i == -1) return false;
356 final String suf = path.substring(i).toLowerCase(Locale.ENGLISH);
357 for(final String suffix : suffixes) {
358 if(suf.equals(suffix)) return true;
359 }
360 return false;
361 }
362
363 /**
364 * Writes data from an input stream to an output stream.

Callers 3

hasSuffixMethod · 0.95
pathMethod · 0.95
mergeMethod · 0.95

Calls 3

lastIndexOfMethod · 0.80
substringMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected