Java BufferedReader Read load(final String path, final String file)

Here you can find the source of load(final String path, final String file)

Description

load

License

Open Source License

Declaration

public static String load(final String path, final String file) throws IOException 

Method Source Code


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

public class Main {
    public static String load(final String path, final String file) throws IOException {
        InputStream stream = ClassLoader.getSystemClassLoader().getResourceAsStream(path + file);
        BufferedReader reader = new BufferedReader(new InputStreamReader(stream));

        StringBuilder builder = new StringBuilder();

        String line;/*w w w  .j  a  v  a 2s  .  c  o  m*/
        while ((line = reader.readLine()) != null) {
            builder.append(line);
        }

        reader.close();

        return builder.toString().trim();
    }
}

Related

  1. load(File file)
  2. load(File pFile)
  3. load(final Multimap map, final Reader source)
  4. load(String filename)
  5. loadAddressList(String filename)
  6. loadAFileToString2(File f)
  7. loadAPIKey(InputStream in)