20 August, 2014

Read Files From Folder

Hi All,

You can use below code to read files from specific folders :

import java.io.File;
public class Test {
    /**
     * @param args
     */  
public static void listFilesForFolder(File folder) {
       
        for (File fileEntry : folder.listFiles()) {
            if (fileEntry.isDirectory()) {
                listFilesForFolder(fileEntry);
            } else {
               
                System.out.println(fileEntry.getName());
            }
        }
        System.out.println("Total :" +folder.listFiles().length);
    }
    public static void main(String[] args) {
       
        final File folder = new File("C:/Users/jignesh.vachhani/Desktop/Jignesh");
        listFilesForFolder(folder);

    }

}

Rate Me:

Liferay 7.3 compatibility matrix

Compatibility Matrix Liferay's general policy is to test Liferay Portal CE against newer major releases of operating systems, open s...