Java Folder Read getFiles(String path)

Here you can find the source of getFiles(String path)

Description

get Files

License

Apache License

Declaration

private static List<String> getFiles(String path) 

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> getFiles(String path) {
        List<String> classes = new ArrayList<String>();
        for (File file : new File(path).listFiles()) {
            if (file.getName().endsWith(".java")) {
                classes.add(file.getPath());
            } else if (file.isDirectory() && !file.getName().startsWith(".")) {
                classes.addAll(getFiles(file.getAbsolutePath()));
            }/*from   ww w . j a va  2  s . co  m*/
        }
        return classes;
    }
}

Related

  1. getFiles(String path)
  2. getFiles(String path)
  3. getFiles(String PATH)
  4. getFiles(String path)
  5. getFiles(String path)
  6. getFiles(String path, final String suffix)
  7. getFiles(String path, String endian)
  8. getFiles(String paths)
  9. getFiles(String realpath, List files, String[] fileType)