Android Folder File List listFile(File file)

Here you can find the source of listFile(File file)

Description

list File

License

Apache License

Declaration

public static List<String> listFile(File file) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;
import java.util.ArrayList;
import java.util.List;

public class Main {
    private static List<String> fileNames = new ArrayList<>();

    public static List<String> listFile(File file) {
        if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (File f : files) {
                listFile(f);//from   w ww.  j a va2s  . c o m
            }
        } else {
            fileNames.add(file.getAbsolutePath());
        }
        return fileNames;
    }
}

Related

  1. getFileNames(String dirPath)
  2. getFileNames(String dirPath, FilenameFilter fileNameFilter)
  3. getFiles(File dir, List outList)
  4. listFiles(String fileName)
  5. pathContains(String root, String child)
  6. listFiles(File file)
  7. getFileList(File f)
  8. getAllFiles(File root)
  9. getAllFiles(File root, FileFilter filter)