How to input several csv files from a prticular folder and exporting them in another folder in JAVA?

I have written the code which lists the name of the csv files from a folder then takes input from a different folder to read subject-1.csv then after sorting them out exporting result-1.txt in Export folder then again taking another input as subject-2.csv from another folder, then sorting and exporting result-2.txt in the Export folder and I have one class called Student because all the csv files have same format.

But my task is to read all the files from a single folder then reading and sorting subject-1.csv then exporting like result-1.txt then writing in Export folder the same way for subject-2.csv and exporting result-2.txt.

All files must be read from a particular folder and exporting in another folder. Only two folder have to do all the tasks.

The main is below

public static void main(String[] args) throws IOException,    
InterruptedException { 

  String data = "UNSORTED"+":  " 
        + ""
        +""; 

  File directory = new File("conf/files");
  File[] listOfFiles = directory.listFiles();

  for (File file1 : listOfFiles) {

      System.out.println(" CSV file found  -------------->  " +     
file1.getName());   

readAllLinesFromFile("conf/subject-1.csv");// reading

    TimeUnit.SECONDS.sleep(5);

readAllLinesFromFile1("conf/files/subject-2.csv");// reading

  }

File file = new File("Export/result-1.txt");
  FileOutputStream fis = new FileOutputStream(file);
PrintStream out = new PrintStream(fis);
out.write(data.getBytes()); 
System.out.println("Sorting out successful");

 for(String aStudentString: aList){

    System.setOut(out);

}

 File file1 = new File("Export/result-2.txt");
   FileOutputStream fis1 = new FileOutputStream(file1);
 PrintStream out1 = new PrintStream(fis1);
 out1.write(data.getBytes()); 
 System.out.println("Sorting out successful");

  for(String aStudentString1: aList1){

    System.setOut(out1);

 }

ArrayList<Student> students = convertToStudents(aList);   
System.out.println("SORTED:n");
for(Student student : students){
    System.setOut(out );
 System.out.println(student.toString()+"n");  

}        

ArrayList<Student> students1 = convertToStudents(aList1);   
System.out.println("SORTED:n");
for(Student student1 : students1){
    System.setOut(out1 );
 System.out.println(student1.toString()+"n");  

}        

}

At the moment I can do it by different folders and mentioning their names what to read and write.

My new idea is below but not getting the way out how to make it functioning.

File [] files = new File(path ).listFiles(new FileFilter() {
    @Override
    public boolean accept(File path) {
        if(path .isFile()) {
 System.out.println("File name is  -------------->" + path.getName());   

            //Do something with a single file (reading and writing tested)
            //or just return true to put it in the list
            return true;
        }
        return false;
    }
 }); 

Sample of csv files

rt,trial_type,trial_index,time_elapsed,internal_node_id,subject,responses,question

27883,survey-text,7,371196,0.0_7.0,7483,{Q0:feet_Q1:hands_Q2:shoes_Q3:man_Q4:},11_chair

16163,survey-text,8,388380,0.0_8.0,7483,{Q0:bird_Q1:snow_Q2:cat_Q3:leaves_Q4:},22_branch

I have been stuck for a long time, please help me out.

`