List of utility methods to do BufferedReader Read
String | loadSQLFromFile(String fileName) Loads teh content of SQL statement from the specified file. BufferedReader reader = new BufferedReader(new FileReader(fileName)); String line; StringBuilder sql = new StringBuilder(); try { while ((line = reader.readLine()) != null) { sql.append(line).append(" "); } finally { ... |
ArrayList | loadStream(InputStream is) load Stream ArrayList<String> list = new ArrayList<String>(); BufferedReader tis = new BufferedReader(new InputStreamReader(is)); String str = tis.readLine(); while (str != null) { list.add(str); str = tis.readLine(); tis.close(); ... |
String | loadStreamContent(InputStream stream) Loads a file into string StringBuilder content = new StringBuilder(); BufferedReader reader = new BufferedReader(new InputStreamReader(stream, "UTF-8")); try { char[] buff = new char[1024]; int i = 0; while ((i = reader.read(buff)) != -1) { content.append(buff, 0, i); } finally { reader.close(); return content.toString(); |
void | loadSystemClassPath() load System Class Path try { File file = new File("../classpath.txt"); if (!file.exists()) return; BufferedReader bf = new BufferedReader(new FileReader("../classpath.txt")); syspath = bf.readLine(); System.out.println(syspath); File pfile = new File(syspath); ... |
void | loadTableList(List Loads table list file and fill a list. File file = new File(fileName); if (file.exists()) { BufferedReader in = new BufferedReader(new FileReader(file)); String line; while ((line = in.readLine()) != null) { line = line.trim(); if (line.length() > 0) { list.add(line); ... |
String | loadTemplate(final String resource) Loads the specified resource file and returns it as String. final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource); final StringBuilder ret = new StringBuilder(); readerToBuilder(new InputStreamReader(is), ret); return ret.toString(); |
String | loadTemplate(String templateUrl) load Template try (InputStream input = Thread.currentThread().getContextClassLoader().getResourceAsStream(templateUrl)) { if (input == null) { throw new IOException("Could not find template at location: " + templateUrl); try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) { StringBuilder stringBuilder = new StringBuilder(); String line = null; while ((line = reader.readLine()) != null) { ... |
Map | loadTemplateParametersFile(File f) load Template Parameters File Map<String, String> toret = new HashMap<String, String>(); BufferedReader br; try { br = new BufferedReader(new FileReader(f)); } catch (FileNotFoundException e1) { return toret; if (!f.exists()) { ... |
String | loadTestFixture(String path) Loads the contents of the test fixture specified at the given path. BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(path))); StringBuilder sb = new StringBuilder(); String line; while ((line = br.readLine()) != null) { sb.append(line); return sb.toString(); |
int[] | loadTestUserEventRelation(String eventFilePath, HashMap Build TestUser2EventIndexSetMap and TestUserIndices. if (!new File(eventFilePath).exists()) { System.err.println(String.format("Event file %s doesn't exist.\n", eventFilePath)); exit(1); BufferedReader br = null; try { br = new BufferedReader(new FileReader(eventFilePath)); } catch (FileNotFoundException e) { ... |