Java BufferedReader Read loadAuthFile(String fileName)

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

Description

load Auth File

License

LGPL

Declaration

public static String loadAuthFile(String fileName) 

Method Source Code


//package com.java2s;
//License from project: LGPL 

import java.io.*;

public class Main {
    public static String loadAuthFile(String fileName) {
        try {/*  ww w  .j  a v  a2  s. c o  m*/
            File file = new File(fileName);
            if (!file.exists())
                return null;

            BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
            StringBuffer buffer = new StringBuffer();
            String line = null;
            while ((line = in.readLine()) != null) {
                buffer.append(line);
            }
            in.close();
            return buffer.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }

    }
}

Related

  1. load(final String path, final String file)
  2. load(String filename)
  3. loadAddressList(String filename)
  4. loadAFileToString2(File f)
  5. loadAPIKey(InputStream in)
  6. loadBase64Object(BufferedReader rdr, String type)
  7. loadBlackList(String blackListPath)
  8. loadBussinessGroupCompanies(String file_path)
  9. loadByUsingSplit(String filename)