Java File Name Get getFilenameFilter(final String extension)

Here you can find the source of getFilenameFilter(final String extension)

Description

get Filename Filter

License

Open Source License

Declaration

public static FilenameFilter getFilenameFilter(final String extension) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;
import java.io.FilenameFilter;

public class Main {
    public static FilenameFilter getFilenameFilter(final String extension) {
        return new FilenameFilter() {

            @Override//from w w w .j  a v a  2s . c  om
            public boolean accept(File file, String name) {
                return file.isFile() && name.endsWith(extension);
            }
        };
    }
}

Related

  1. getFileName(String template, String className, String packageName)
  2. getFileName(String url, String basePath)
  3. getFileNameAndExt(String s)
  4. getFileNameArrayFromDirectory(String directoryLocation)
  5. getFileNameFilter(final String endsWith)
  6. getFilenameFilter(final String pFilter, final boolean pExclude)
  7. getFilenameForClassName(String className)
  8. getFileNameFromCanonical(String file)
  9. getFileNameFromFilePath(String filePath)