Java InputStreamReader Read readFileList(File file)

Here you can find the source of readFileList(File file)

Description

read File List

License

Open Source License

Declaration

protected static List<File> readFileList(File file) throws FileNotFoundException, IOException 

Method Source Code


//package com.java2s;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

import java.util.List;

public class Main {
    protected static List<File> readFileList(File file) throws FileNotFoundException, IOException {
        List<File> files = new ArrayList<File>();
        String path = file.getParentFile().getAbsolutePath();
        BufferedReader content = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
        String line = content.readLine();
        while (line != null) {
            files.add(new File(path + "/" + line));
            line = content.readLine();//w ww.j a  v  a 2s. co  m
        }
        return files;
    }
}

Related

  1. readFileFromResource(@SuppressWarnings("rawtypes") Class refClass, String filePath)
  2. readFileFromResource(String filename)
  3. readFileIntoLines(File file)
  4. readFileIntoLinesOfLongs(File file)
  5. readFileLineByLine(final File filePath)
  6. readFileOneLine(String filename, String keyInLine)
  7. readFileOrResource(String source)
  8. readFiles(String[] files, String encoding)
  9. readFileSB(File f)