Android Directory Content Get listFiles(File rootDir, final String... sufix)

Here you can find the source of listFiles(File rootDir, final String... sufix)

Description

list Files

Declaration

public static File[] listFiles(File rootDir, final String... sufix) 

Method Source Code

//package com.java2s;

import java.io.File;

import java.io.FilenameFilter;

public class Main {
    public static File[] listFiles(File rootDir, final String... sufix) {
        return rootDir.listFiles(new FilenameFilter() {

            @Override/*from w  ww . j a v  a  2  s  .  c o m*/
            public boolean accept(File dir, String name) {
                for (String s : sufix) {
                    if (name.toLowerCase().endsWith(s.toLowerCase())) {
                        return true;
                    }
                }
                return false;
            }
        });
    }
}

Related

  1. getFilesAndSubFolderFiles(List fileList, File rootDir)
  2. listDirs(File file)
  3. listDirs(String fileName)
  4. listFile(File dir)
  5. listFiles(File dir)
  6. getFileList(String path)
  7. listFilesByDirectory(String directoryPath, boolean isOnlyFile)
  8. listFiles(final String directory, final boolean root)