Java Path File Check nio isFileHidden(Path file)

Here you can find the source of isFileHidden(Path file)

Description

is File Hidden

License

Open Source License

Declaration

public static boolean isFileHidden(Path file) 

Method Source Code

//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*/
}

Related

  1. isEmptyDir(Path path)
  2. isEqualPath(final Path file1, final String topLevelAbsolutePath)
  3. isExcluded(Set excludes, Path path)
  4. isFile(final String path)
  5. isFile(Path file)
  6. isFileSymLink(File path)
  7. isFileWritable(final Path file)
  8. isFolder(Path path)
  9. isHidden(final Path path)