package com.platform.test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import com.platform.entities.FolderNode;

public class FolderReader {

	public static FolderNode reader(String path) {
		FolderNode folderNode = null;
		File file = new File(path);
		if (file.exists()) {
			List<FolderNode> childrens = new ArrayList<FolderNode>();
			if (file.isDirectory()) {
				File[] files = file.listFiles();
				for (int i = 0; i < files.length; i++) {
					FolderNode children = reader(files[i].getAbsolutePath());
					if (children != null)
						childrens.add(children);
				}
			}
		}
		return folderNode;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		FolderReader folderReader =  new FolderReader();
		FolderNode folderNode = folderReader.reader("D:/bootstrap");	
		//folderReader.print(folderNode);
	}

}
