Package java.io

Examples of java.io.FileReader


        if (resultsFile != null) {
            resultsOutputStream = new FileOutputStream(resultsFile);
        }
        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
        return writeAndCompareResultSet(rs, maxColWidth, printMetadata, resultsOutputStream, expectedResultsReader, printToConsole ? System.out : null);
    }
View Full Code Here


        if (resultsFile != null) {
            resultsOutputStream = new FileOutputStream(resultsFile);
        }
        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
        return writeAndCompareThrowable(t, resultsOutputStream, expectedResultsReader, printToConsole ? System.out : null);
    }
View Full Code Here

  * @param file readable file containing template source
  * @throws IOException when an i/o error occurs while reading the template.
  */
  public Jtpl(File file) throws IOException
  {
    FileReader fr = new FileReader(file);
    String fileText = readFile(fr);
    makeTree(fileText);
 
View Full Code Here

   
   
    public static List compareThrowable(Throwable t, String query, File expectedResultsFile, boolean printToConsole) throws IOException, SQLException  {
        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
       
        PrintStream out =  TestResultSetUtil.getPrintStream(null,expectedResultsReader, printToConsole ? System.out : null);
        
         printThrowable(t, query, out);
View Full Code Here

        if (resultsFile != null) {
            resultsOutputStream = new FileOutputStream(resultsFile);
        }
        BufferedReader expectedResultsReader = null;
        if (expectedResultsFile != null && expectedResultsFile.exists() && expectedResultsFile.canRead()) {
            expectedResultsReader = new BufferedReader(new FileReader(expectedResultsFile));
        }
        return writeAndCompareResultSet(rs, query, maxColWidth, printMetadata, resultsOutputStream, expectedResultsReader, printToConsole ? System.out : null);
    }
View Full Code Here

    if (inCache(filename, last_modified)) {
      return templates_.get(filename);
    }

    FileReader reader;
    try {
      reader = new FileReader(filename);
    } catch (FileNotFoundException e) {
      throw new TemplateException(e);
    }

    String contents;
View Full Code Here

   
        // Add users
        Map vars = new HashMap();
        Reader reader;
    try {
      reader = new FileReader(new File("./src/test/resources/LoadUsers.mvel"));
   
        Map<String, User> users = ( Map<String, User> ) eval( reader, vars );  
        for ( User user : users.values() ) {
          taskSession.addUser( user );
         
        }          
        reader = new FileReader(new File("./src/test/resources/LoadGroups.mvel"));     
        Map<String, Group> groups = ( Map<String, Group> ) eval( reader, vars );    
        for ( Group group : groups.values() ) {
            taskSession.addGroup( group );
        }
    } catch (FileNotFoundException e) {
View Full Code Here

  // All transform methods must be static and must contain the @Transformer annotation
  @Transformer
  public static String fileToString(File file) {
    try {
      String fileString = "";
      BufferedReader reader = new BufferedReader(new FileReader(file));
      String line = "";
      while ((line = reader.readLine()) != null) {
        fileString += line;
      }
      return fileString;
View Full Code Here

  }

  @Transformer
  public static BufferedReader fileToBufferedReader(File file) {
    try {
      BufferedReader reader = new BufferedReader(new FileReader(file));
      return reader;
    } catch (Exception e) {
      System.err.println("Failed to read file " + file.getName());
    }
    return null;
View Full Code Here

    private int lastIndex;
    private long lastTime;
    private BufferedWriter trace;

    private Profile() {
        FileReader reader = null;
        try {
            reader = new FileReader("profile.txt");
            LineNumberReader r = new LineNumberReader(reader);
            while (r.readLine() != null) {
                // nothing - just count lines
            }
            maxIndex = r.getLineNumber();
View Full Code Here

TOP

Related Classes of java.io.FileReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.