Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.io.File;

import java.util.ArrayList;
import java.util.List;

public class Main {
    static private List<File> getFiles(String src) {
        List<File> list = new ArrayList<File>();
        File f = new File(src);
        File files[] = f.listFiles();
        for (File file : files) {
            if (file.isFile()) {
                list.add(file);
            } else {
                list.addAll(getFiles(file.getPath()));
            }
        }
        return list;
    }
}