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> getFolderContent(String folderDir) {
        File file = new File(folderDir);
        List<String> filesPath = new ArrayList<>();
        if (!file.exists()) {

        } else {
            for (File f : file.listFiles()) {
                if (f.isFile()) {
                    filesPath.add(f.getPath());
                }
            }
        }
        return filesPath;
    }
}