Here you can find the source of isFileHidden(Path file)
public static boolean isFileHidden(Path file)
//package com.java2s; //License from project: Open Source License import java.nio.file.Path; import java.util.ArrayList; import java.util.List; public class Main { public static boolean isFileHidden(Path file) { List<String> illegal = new ArrayList<String>(); illegal.add("$"); illegal.add("."); illegal.add("~"); return illegal.stream().anyMatch(pattern -> file.getFileName().toString().startsWith(pattern)); }/* w ww. ja v a2 s. c om*/ }