Package java.io

Examples of java.io.FileWriter


    private void initWebXml() {
        try {
            if (webxmlLevel >= INC_WEBXML) {
                File fmapings = new File(webxmlFile);
                mapout = new FileWriter(fmapings);
                servletout = new CharArrayWriter();
                mappingout = new CharArrayWriter();
            } else {
                mapout = null;
                servletout = null;
View Full Code Here


    File store = getPersistentFile(servletContext);

    Writer w = null;
    try {
      if (store != null) {
        w = new FileWriter(store);
      }
      // TODO consider moving implementation to HttpSessionContextImpl
      Enumeration e = sessions.elements();
      while (e.hasMoreElements()) {
        AcmeSession session = (AcmeSession) e.nextElement();
View Full Code Here

    // it shouldn't be invalidated
    File sf = getPersistentFile();
    if (sf != null && sessions != null) {
      Writer w = null;
      try {
        w = new FileWriter(sf);
        sessions.save(w);
        log("TJWS: Sessions stored.");
      } catch (IOException ioe) {
        log("TJWS: IO error in storing sessions " + ioe);
      } catch (Throwable t) {
View Full Code Here

     *
     * @param s the message
     * @param e the exception or null
     */
    protected void traceOperation(String s, Exception e) {
        FileWriter writer = null;
        try {
            File f = new File(getBaseDir() + "/" + TRACE_FILE_NAME);
            f.getParentFile().mkdirs();
            writer = new FileWriter(f, true);
            PrintWriter w = new PrintWriter(writer);
            s = dateFormat.format(new Date()) + ": " + s;
            w.println(s);
            if (e != null) {
                e.printStackTrace(w);
View Full Code Here

    Writer writer = null;
    try {
      reader = new FileReader(new File("/home/tbinias/eclipse/plugin-dev/WGAEclipseEditors/resources/wga/tmlTagDefinitionsXStream.xml"));
      TMLTagDefinitions def = TMLTagDefinitions.fromXML(reader);
      def.getTagByName("item").getValidators().add("de.innovationgate.test");
      writer = new FileWriter(new File("/tmp/defout.xml"));
      def.toXML(def, writer);
    } finally {
      if (reader != null) {
        reader.close();
      }
View Full Code Here

  return;

    try {
  LayoutEngine le = null;
  if (I18N.get("ExportWin.le_comma").equals(choice))
      le = new CharSepLE(new PrintWriter(new FileWriter(path)), ',');
  else if (I18N.get("ExportWin.le_tab").equals(choice))
      le = new CharSepLE(new PrintWriter(new FileWriter(path)), '\t');
  else if (I18N.get("ExportWin.le_docbook").equals(choice))
      le = new DocBookLE(new PrintWriter(new FileWriter(path)));
  else if (I18N.get("ExportWin.le_html").equals(choice))
      le = new HTMLLE(new PrintWriter(new FileWriter(path)));
  else if (I18N.get("ExportWin.le_latex").equals(choice))
      le = new LaTeXLE(new PrintWriter(new FileWriter(path)));
  else if (I18N.get("ExportWin.le_pdf").equals(choice))
      le = new PDFLE(new FileOutputStream(path));
  else if (I18N.get("ExportWin.le_xml").equals(choice))
      le = new XMLLE(new XMLWriter(new FileOutputStream(path)));
  else if (I18N.get("ExportWin.le_xls").equals(choice))
      le = new ExcelLE(new FileOutputStream(path),false);
  else if (I18N.get("ExportWin.le_csshtml").equals(choice))
      le = new CSSHTMLLE(new PrintWriter(new FileWriter(path)));

  if (le != null) {
      report.setLayoutEngine(le);
      report.run();
  }
View Full Code Here

      ret = file.createNewFile();
    } else {
      ret = true;
    }
    if (ret)
      return new BufferedWriter(new FileWriter(file, true));
    else
      return null;
  }
View Full Code Here

    private void listUnvisited() throws IOException {
        printLine('=');
        print("NOT COVERED");
        printLine('-');
        FileReader reader = null;
        FileWriter fileWriter = null;
        try {
            reader = new FileReader("profile.txt");
            LineNumberReader r = new LineNumberReader(reader);
            fileWriter = new FileWriter("notCovered.txt");
            BufferedWriter writer = new BufferedWriter(fileWriter);
            int unvisited = 0;
            int unvisitedThrow = 0;
            for (int i = 0; i < maxIndex; i++) {
                String line = r.readLine();
View Full Code Here

            } else {
                c.addDir(s, recurse);
            }
        }
        try {
            c.data = new BufferedWriter(new FileWriter("profile.txt"));
            c.processAll();
            c.data.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
View Full Code Here

            return;
        }
        File f = new File(name);
        File fileNew = new File(name + ".new");
        try {
            writer = new BufferedWriter(new FileWriter(fileNew));
            Reader r = new BufferedReader(new FileReader(f));
            tokenizer = new Tokenizer(r);
            indent = 0;
            try {
                process();
View Full Code Here

TOP

Related Classes of java.io.FileWriter

Copyright © 2015 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.