Java Utililty Methods File List from Folder

List of utility methods to do File List from Folder

Description

The list of methods to do File List from Folder are organized into topic(s).

Method

HashSetgetFilesFromFolder(String folder, String mustHave, String doesntMustHave, boolean isPrevious)
Gets the files from folder.
HashSet<String> result = new HashSet<String>();
File dir = new File(folder);
HashSet<String> files = new HashSet<String>();
findAllFiles(dir, files, mustHave, doesntMustHave, isPrevious);
result.addAll(files);
return result;
voidgetFilesFromFolder(String folderPath, ArrayList files)
get Files From Folder
File folder = new File(folderPath);
File[] fList = folder.listFiles();
if (fList != null) {
    for (File file : fList) {
        if (file.isFile()) {
            files.add(file);
        } else if (file.isDirectory()) {
            getFilesFromFolder(file.getAbsolutePath(), files);
...
ListgetFilesFromFolder(String folderPath, boolean withAbsolPath)
get Files From Folder
File folder = new File(folderPath);
List<String> toRet = new ArrayList<>();
String[] allFiles = folder.list();
if (withAbsolPath) {
    for (String file : allFiles) {
        toRet.add(folderPath + File.separator + file);
} else
...