Java FileReader Create getReader(final File file)

Here you can find the source of getReader(final File file)

Description

get Reader

License

Apache License

Declaration

public static FileReader getReader(final File file) 

Method Source Code


//package com.java2s;
/*/*from   w w  w .  j  a va  2 s .  co m*/
 * Copyright 2004-2005 Revolution Systems Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import java.io.File;

import java.io.FileNotFoundException;

import java.io.FileReader;

public class Main {
    public static FileReader getReader(final File file) {
        try {
            return new FileReader(file);
        } catch (final FileNotFoundException e) {
            throw new IllegalArgumentException("File not found: " + file, e);
        }
    }
}

Related

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