List of utility methods to do Path File Check nio
boolean | isJniNativeFunction(Path path) is Jni Native Function if (!path.toString().endsWith("h")) return false; for (String line : Files.readAllLines(path, Charset.defaultCharset())) if (line.contains("/* Header for class")) return true; return false; |
boolean | isJSON(final Path file) is JSON if (getExtension(file).equals("png") || getExtension(file).equals("wav") || getExtension(file).equals("ogg") || getExtension(file).equals("txt") || getExtension(file).equals("lua") || getExtension(file).equals("ttf")) { return false; return true; |
boolean | isJsonFile(Path filePath) is Json File return (Files.isRegularFile(filePath) && filePath.toString().toLowerCase().endsWith(JSON_EXT));
|
boolean | isOva(final Path filePath) is Ova return ovaMatcher.matches(filePath);
|
boolean | isParent(Path parent, Path child) is Parent parent = parent.normalize().toAbsolutePath();
child = child.normalize().toAbsolutePath();
return child.getNameCount() > parent.getNameCount() && child.startsWith(parent);
|
boolean | isParent(Path parent, Path path) is Parent while ((path = path.getParent()) != null) { if (path.equals(parent)) { return true; return false; |
boolean | isParentOf(Path possibleParent, Path possibleChild) Determine if one path is a child of another. return possibleChild.startsWith(possibleParent);
|
boolean | isPath(Class> clazz) is Path if (pathClass == null && !pathClass_error) { try { pathClass = Class.forName("java.nio.file.Path"); } catch (Throwable ex) { pathClass_error = true; if (pathClass != null) { ... |
boolean | isPermission(Path p, Function is Permission Objects.requireNonNull(p);
Objects.requireNonNull(function);
return function.apply(p);
|
boolean | isPictureFile(Path file) is Picture File return file.toString().toLowerCase().endsWith(".png") || file.toString().toLowerCase().endsWith(".jpg") || file.toString().toLowerCase().endsWith(".jpeg") || file.toString().toLowerCase().endsWith(".bmp") || file.toString().toLowerCase().endsWith(".gif") || file.toString().toLowerCase().endsWith(".tif") || file.toString().toLowerCase().endsWith(".tiff") || file.toString().toLowerCase().endsWith(".ico"); |