Java FileReader Create getFileReader(String fileName)

Here you can find the source of getFileReader(String fileName)

Description

Getting a file reader of fileName

License

Open Source License

Parameter

Parameter Description
fileName a parameter

Declaration

public static FileReader getFileReader(String fileName) 

Method Source Code

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

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;

public class Main {
    /**/*  w  w  w . j a  v  a 2 s .  c  o m*/
     * Getting a file reader of {@code fileName}
     * @param fileName
     * @return
     */
    public static FileReader getFileReader(String fileName) {
        return getFileReader(new File(fileName));
    }

    /**
     * Getting a file reader of {@code file}
     * @param fileName
     * @return
     */
    public static FileReader getFileReader(File file) {
        try {
            return new FileReader(file);
        } catch (FileNotFoundException e) {
            throw new IllegalArgumentException(e);
        }
    }
}

Related

  1. getFileReader(File file)
  2. getFileReader(File file)
  3. getFileReader(String fileName)
  4. getFileReader(String filename)
  5. getFileReader(String filePath)
  6. getFileReader(String sFileName)
  7. getReader(final File file)
  8. readTextFile(File aFile)