00001 package edu.stanford.hci.r3.util.files.filters;
00002
00003 import java.io.File;
00004
00005 import edu.stanford.hci.r3.util.files.FileUtils;
00006 import edu.stanford.hci.r3.util.files.Visibility;
00007
00020 public class FileExcludeHiddenFilter extends FileExtensionFilter {
00021
00022 public FileExcludeHiddenFilter() {
00023 super(ACCEPT_ALL, true, Visibility.VISIBLE);
00024 }
00025
00026 public FileExcludeHiddenFilter(String[] exts) {
00027 super(exts, true, Visibility.VISIBLE);
00028 }
00029
00030 public FileExcludeHiddenFilter(String[] exts, boolean dir) {
00031 super(exts, dir, Visibility.VISIBLE);
00032 }
00033
00034 public boolean accept(File f) {
00035 if (FileUtils.isHiddenOrDotFile(f)) {
00036
00037 return false;
00038 } else {
00039 return super.accept(f);
00040 }
00041 }
00042
00043 public boolean accept(File fileDir, String name) {
00044 if (FileUtils.isHiddenOrDotFile(new File(fileDir, name))) {
00045
00046 return false;
00047 } else {
00048 return super.accept(fileDir, name);
00049 }
00050 }
00051
00052 }