modules/tests/test-integration/src/test/java/org/ballerinalang/test/listener/TestExecutionListener.java
/**
     * List the file in a given directory.
     *
     * @param path of the directory
     * @param list   collection of files found
     * @return String arrays of file absolute paths
     */
List the file in a given directory.
@param path of the directory
@param list   collection of files found
@return String arrays of file absolute paths
List the file in a given directory . @param path of the directory @param list collection of files found @return String arrays of file absolute paths
private static String[] listFiles(String path, List<String> list) {
        File folder = new File(path);
        File[] listOfFiles = folder.listFiles();
        if (list.size() > 100) {
            log.warn("Sample file deployment restricted to 100 files");
            return list.toArray(new String[]{});
        }
        if (listOfFiles != null) {
            for (File file : listOfFiles) {
                if (file.isDirectory()) {
                    log.info("Searching service ballerina files in " + file.getPath());
                    listFiles(file.getAbsolutePath(), list);
                } else {
                    if (file.getPath().endsWith(Constant.SERVICE_FILE_EXTENSION)) {
                        log.info("Adding file " + file.getPath());
                        list.add(file.getAbsolutePath());
                    }
                }
            }
        }
        return list.toArray(new String[]{});
    }
private static String [ ] listFiles ( String path , List < String > list ) { File folder = new File ( path ) ; File [ ] listOfFiles = folder . listFiles ( ) ; if ( list . size ( ) > 100 ) { log . warn ( "Sample file deployment restricted to 100 files" ) ; return list . toArray ( new String [ ] { } ) ; } if ( listOfFiles != null ) { for ( File file : listOfFiles ) { if ( file . isDirectory ( ) ) { log . info ( "Searching service ballerina files in " + file . getPath ( ) ) ; listFiles ( file . getAbsolutePath ( ) , list ) ; } else { if ( file . getPath ( ) . endsWith ( Constant . SERVICE_FILE_EXTENSION ) ) { log . info ( "Adding file " + file . getPath ( ) ) ; list . add ( file . getAbsolutePath ( ) ) ; } } } } return list . toArray ( new String [ ] { } ) ; }
List the file in a given directory.
List the file in a given directory .
//returning the search when it comes to 100 files