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 {
    public static List<String> getSubFolderList(String dir) {
        List<String> results = new ArrayList<String>();
        File file = new File(dir);
        String[] names = file.list();

        for (String name : names) {
            if (new File(dir + "/" + name).isDirectory()) {
                results.add(name);
            }
        }
        return results;
    }
}