Java Folder Read by Filter getFilesOnlyFilter()

Here you can find the source of getFilesOnlyFilter()

Description

get Files Only Filter

License

Apache License

Return

a implementation that returns only files.

Declaration

public static FileFilter getFilesOnlyFilter() 

Method Source Code

//package com.java2s;
// Licensed under the Apache License, Version 2.0 (the "License");

import java.io.File;
import java.io.FileFilter;

public class Main {
    private static final FileFilter filesOnlyFilter = new FileFilter() {
        public boolean accept(File pathname) {
            return pathname.isFile();
        }/* ww w .  ja v  a2 s. c om*/
    };

    /**
     * @return a {@link FileFilter} implementation that returns only files.
     */
    public static FileFilter getFilesOnlyFilter() {
        return filesOnlyFilter;
    }
}

Related

  1. getFiles(File root, boolean recurse, FileFilter fileFilter)
  2. getFiles(final File directory, final FilenameFilter filter)
  3. getFiles(String name, FileFilter filter, boolean includeSubtree)
  4. getFiles(String sourceDirPath, FilenameFilter filter, Comparator comparator)
  5. getFiles(String sourceName, FilenameFilter filter)
  6. getFilesRealWorking(File aStartingDir, FilenameFilter filter)
  7. getFilesUnder(String path, FileFilter fileFilter)
  8. getFilesWithFilter(String DirectoryName, FilenameFilter Filter)