Package java.io

Examples of java.io.FileWriter


        comp.writeResults();
    }

    private void writeResults() {
        try {
            BufferedWriter writer = new BufferedWriter(new FileWriter(file));
            StringBuffer res = new StringBuffer("<document>\n" + "<properties>\n" + "<title>Performance comparison with HashMap</title>\n" + "</properties>\n"
                    + "<body>" +
                        "<section name=\"Test harness\"><p>All tests will be successfull " +
                        "50% of the time, the other 50% will not be successfull, since the" +
                        "Maps is pre-initialized for each test with keys/values 0-500, and the tests are runned with" +
View Full Code Here


                if (!dir.exists()) {
                    dir.mkdirs();
                }
               
                // generate site page from template
                FileWriter writer = new FileWriter(file);
                m_template.initDocument();
                m_template.merge(vctx, writer);
                writer.close();
                actives.remove(item);
            }
           
            // process all child components recursively
            ArrayList childs = comp.getChildren();
View Full Code Here

  public static void print(final RenderBox box)
  {
    try
    {
      final File file = File.createTempFile("model-dump-", ".txt");
      final BufferedWriter writer = new BufferedWriter(new FileWriter(file));
      printBox(writer, box, 0);
      writer.close();
    }
    catch (Exception e)
    {
View Full Code Here

     * @throws IOException Thrown when the file cannot be found/written
     *                     to.
     */
    public static void setLogFile(String logFile) throws IOException {
        if (log != null) log.close();
        log = new FileWriter(logFile, true);
    }
View Full Code Here

                final File parent = this.reportFile.getParentFile();
                if (parent != null && !parent.exists())
                {
                    parent.mkdirs();
                }
                final FileWriter writer = new FileWriter(this.reportFile);
                writer.write(report.toString());
                writer.flush();
                writer.close();
            }
            catch (IOException exception)
            {
                throw new RuntimeException(exception);
            }
View Full Code Here

    System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");
   
   
    String basePath = this.getClass().getResource("").getFile();
    File testFile = new File(basePath + File.separator + "werewrewre.bin");
    FileWriter fw = new FileWriter(testFile);
    fw.write("ewrdfsdfsfsfdffdfdsfds");
    fw.close();
   
    // start xSocket
    Context ctx = new Context("");
    ctx.addHandler("/site/*", new FileServiceRequestHandler(basePath, true));
    ctx.addHandler(new AnnotatedHandler());
View Full Code Here

        final String full_path = (dialog.getFilterPath() + File.separator + filename);
        final String content = log_content.getText();
        new Thread( new JMRunnable() {
          public void JMRun() {
            try {
              FileWriter file_writer = new FileWriter(full_path);
              file_writer.write(content);
              file_writer.close();
            } catch (IOException e) {
            }
          }}).start();
      }
    });
View Full Code Here

    System.setProperty(IHttpExchange.SHOW_DETAILED_ERROR_KEY, "true");
   
   
    String basePath = this.getClass().getResource("").getFile();
    File testFile = new File(basePath + File.separator + "werewrewrewrewr.bin");
    FileWriter fw = new FileWriter(testFile);
    fw.write("ewrdfsdfsfsfdsfds");
    fw.close();
   
    // start xSocket
    Context ctx = new Context("");
    ctx.addHandler("/site/*", new FileServiceRequestHandler(basePath, true));
    ctx.addHandler("/rpc/*", new MyBusinessHandler());
View Full Code Here

            long length = file.length();
            if ( length > maxSize*1024 ) {
              append = false;
            }
          }
            FileWriter fw = new FileWriter(fileName, append);
            fw.write(msg + "\n");
            fw.close();
        } catch (Exception e) {
            ErrorHandler.reportError("Exception while trying to write to file: " + fileName, e);
        }
    }
View Full Code Here

            long length = file.length();
            if ( length > maxSize*1024 ) {
              append = false;
            }
          }
            FileWriter fw = new FileWriter(fn, append);
            fw.write(msg + "\n");
            fw.close();
        } catch (Exception e) {
            ErrorHandler.reportError("Exception while trying to write to file: " + fn,e);
        }
    }
View Full Code Here

TOP

Related Classes of java.io.FileWriter

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.