chapter_009/src/main/java/ru/job4j/io/Args.java
/**
     * Check file if it is a file than add in the collection, else if is a directory call a method find.
     *
     * @param directory - source way.
     */
Check file if it is a file than add in the collection, else if is a directory call a method find.
@param directory - source way.
Check file if it is a file than add in the collection else if is a directory call a method find . @param directory - source way .
private void find(String directory) {
        File root = new File(directory);
        File[] files = root.listFiles();
        for (File file : files) {
            if (!file.isDirectory()) {
                this.files.add(file);
            } else {
                find(file.getPath());
            }
        }
    }
private void find ( String directory ) { File root = new File ( directory ) ; File [ ] files = root . listFiles ( ) ; for ( File file : files ) { if ( ! file . isDirectory ( ) ) { this . files . add ( file ) ; } else { find ( file . getPath ( ) ) ; } } }
Check file if it is a file than add in the collection, else if is a directory call a method find.
Check file if it is a file than add in the collection else if is a directory call a method find .