Java Folder Read getFileString(String filePath)

Here you can find the source of getFileString(String filePath)

Description

get File String

License

Apache License

Declaration

public static String getFileString(String filePath) throws IOException 

Method Source Code


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

import java.io.BufferedReader;

import java.io.FileReader;
import java.io.IOException;

public class Main {
    public static String getFileString(String filePath) throws IOException {
        @SuppressWarnings("resource")
        BufferedReader br = new BufferedReader(new FileReader(filePath));
        StringBuilder sb = new StringBuilder();
        String r = null;/*from  w  w w . j ava2 s  . c om*/
        while ((r = br.readLine()) != null) {
            sb.append(r);
        }
        return sb.toString();
    }
}

Related

  1. getFilesRegex(final File root, final String[] regex)
  2. getFilesStartingWith(File parentDir, String prefix)
  3. getFilesStartingWith(String dirName, String startsWith)
  4. getFileStatus(File file)
  5. getFileString(File file)
  6. getFileStringContent(String filename)
  7. GetFilesWithChildren(File root, ArrayList files)
  8. getFileSystemProperties(String path)
  9. getFileSystemProperty(String name)