Java BufferedReader Read All readAllCourseTime()

Here you can find the source of readAllCourseTime()

Description

read All Course Time

License

Open Source License

Declaration

public synchronized static Vector<String> readAllCourseTime() throws IOException 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Vector;

public class Main {
    public synchronized static Vector<String> readAllCourseTime() throws IOException {
        File file = new File("D:\\CourseSystemDB\\Course");
        String[] cla = file.list();
        Vector<String> claTimeList = new Vector<String>();
        String[] firstLine;/*from w ww  .  j  a v  a2s  .  co  m*/
        for (int i = 0; i < cla.length; i++) {
            File claFile = new File("D:\\CourseSystemDB\\Course\\" + cla[i]);
            BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(claFile)));
            firstLine = reader.readLine().split("  ");
            claTimeList.addElement(firstLine[2]);
            reader.close();
            System.gc();
        }
        return claTimeList;
    }
}

Related

  1. readAll(String ip)
  2. readAll(String path)
  3. ReadAll_Variant2(Reader rd, Writer wr)
  4. readAllCourseNum()
  5. readAllCoursePro()
  6. readAllFromInputStream(InputStream inputStream)
  7. readAllFromInputStreamAsList(InputStream inputStream)
  8. ReadAllFromStream(InputStream source)
  9. readAllLines(File file)