List of utility methods to do FileReader Create
Reader | getFileReader(File file) get File Reader return new FileReader(file); |
BufferedReader | getFileReader(File file) get File Reader return file.getName().endsWith(".gz") ? new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(file)))) : new BufferedReader(new FileReader(file)); |
Reader | getFileReader(String fileName) Obtains a reader for the given already existing file. FileReader reader; File file = new File(fileName); if (file.exists() && file.isFile()) { reader = new FileReader(file); } else { reader = null; return reader; ... |
Reader | getFileReader(String filename) get File Reader return getFileReader(new File(filename)); |
FileReader | getFileReader(String fileName) Getting a file reader of fileName return getFileReader(new File(fileName)); |
Reader | getFileReader(String filePath) get File Reader return new FileReader(filePath); |
FileReader | getFileReader(String sFileName) Return a FileReader for the current file name or null if the file doesn't exist FileReader fr = null; if (sFileName != null) { try { fr = new FileReader(sFileName); } catch (FileNotFoundException e) { fr = null; return fr; |
FileReader | getReader(final File file) get Reader try { return new FileReader(file); } catch (final FileNotFoundException e) { throw new IllegalArgumentException("File not found: " + file, e); |
String | readTextFile(File aFile) read Text File return read(new BufferedReader(new FileReader(aFile))); |
String | readTextFile(File f) read Text File StringBuilder sb = new StringBuilder(); try { if (!f.exists()) { return ""; FileReader reader = new FileReader(f); char[] chars = new char[4096]; int len = 4096; ... |