private List<File> loadFiles(File workingDir) {
        List<File> dataFile = new ArrayList<>();
        if (workingDir.exists()) {
            File[] files = workingDir.listFiles();
            for (File eachFile : files) {
                if (eachFile.isDirectory()) {
                    dataFile.addAll(loadFiles(eachFile));
                } else if (eachFile.getName().endsWith(".yaml") || eachFile.getName().endsWith(".yml")) {
                    dataFile.add(eachFile);
                }

            }
        }
        return dataFile;
    }
private List < File > loadFiles ( File workingDir ) { List < File > dataFile = new ArrayList < > ( ) ; if ( workingDir . exists ( ) ) { File [ ] files = workingDir . listFiles ( ) ; for ( File eachFile : files ) { if ( eachFile . isDirectory ( ) ) { dataFile . addAll ( loadFiles ( eachFile ) ) ; } else if ( eachFile . getName ( ) . endsWith ( ".yaml" ) || eachFile . getName ( ) . endsWith ( ".yml" ) ) { dataFile . add ( eachFile ) ; } } } return dataFile ; }
This method will return all the data files available in the base directory and return List of {@link File}

@param workingDir
- Base directory
@return List<File>