Java File Content Read getFileContent(String filepath)

Here you can find the source of getFileContent(String filepath)

Description

get File Content

License

Open Source License

Declaration

public static String getFileContent(String filepath) throws IOException 

Method Source Code


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

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;

public class Main {
    public static String getFileContent(String filepath) throws IOException {
        File f = new File(filepath);
        BufferedReader reader = new BufferedReader(new FileReader(f));
        String line;//from ww w.j a va 2 s  .  c o m
        String fileContent = "";
        while ((line = reader.readLine()) != null) {
            fileContent += line;
        }
        reader.close();
        return fileContent;
    }
}

Related

  1. getFileContent(String fileName)
  2. getFileContent(String fileName)
  3. getFileContent(String fileName)
  4. getFileContent(String filePath)
  5. getFileContent(String filePath)
  6. getFileContent(String fName)
  7. getFileContent(String path)
  8. getFileContent(String path)
  9. getFileContent(String path)