Package java.io

Examples of java.io.FileWriter


        properties.setProperty( Index.PropertyKeys.PAYLOADCLASS, payload.getClass().getName() );
        if ( field != null ) properties.setProperty( Index.PropertyKeys.FIELD, field );
        properties.save( batchBasename + DiskBasedIndex.PROPERTIES_EXTENSION );

        // We *must* generate a fake term file, or index combination won't work.
        final PrintWriter termWriter = new PrintWriter( new FileWriter( batchBasename + DiskBasedIndex.TERMS_EXTENSION ) );
        termWriter.println( "#" );
        termWriter.close();

        cutPoints.add( cutPoints.getInt( cutPoints.size() - 1 ) + documentCount );
        accumulatorStream.reset();
View Full Code Here


        TextEdit edits = fmtr.format(CodeFormatter.K_COMPILATION_UNIT, text, 0, text.length(), 0, null);
        File gendir = m_package.getGenerateDirectory();
        if (gendir != null) {
            try {
                File file = new File(gendir, m_name + ".java");
                FileWriter fwrit = new FileWriter(file);
                WriterVisitor visitor = new WriterVisitor(text, fwrit);
                edits.accept(visitor);
                visitor.finish();
                fwrit.flush();
                fwrit.close();
                s_logger.info("Generated class file " + file.getCanonicalPath() + " (writing AST took " + (System.currentTimeMillis()-start) + " ms.)");
            } catch (IOException e) {
                throw new IllegalStateException("Error in source generation: " + e.getMessage());
            }
        }
View Full Code Here

    void write(File outputFile) throws IOException {
        BufferedWriter writer = null;
        try {
            final Map<String, JavadocOptionFileOption> options = optionFile.getOptions();
            writer = new BufferedWriter(new FileWriter(outputFile));
            JavadocOptionFileWriterContext writerContext = new JavadocOptionFileWriterContext(writer);

            for (final String option : options.keySet()) {
                options.get(option).write(writerContext);
            }
View Full Code Here

    if ( f != null ){
     
      PrintWriter   pw = null;
     
      try{
        pw = new PrintWriter(new FileWriter( f, true ));
       
        pw.println( str );
       
      }catch( Throwable e ){
       
View Full Code Here

  public boolean saveXML(final MasterReport report, final String fileName)
  {
    Writer out = null;
    try
    {
      out = new BufferedWriter(new FileWriter(new File(fileName)));

      final XMLProcessor xprc = new XMLProcessor(report);
      xprc.setWriter(out);
      xprc.processReport();
      return true;
View Full Code Here

            IOException {
        Rasterizer r = new Rasterizer();
        JPEGTranscoder jpeg = new JPEGTranscoder();
        r.setTranscodingHints((Map) hints);
        File file = new File("image.jpg");
        FileWriter fw = new FileWriter(file);
        TranscoderOutput output = new TranscoderOutput(fw);
        r.transcode(input, output);
        r.setTranscodingHints((Map) hints);
        jpeg.transcode(input, output);
        return img;
View Full Code Here

    }

    public static void saveTextFile(String stringContent, File destFile) throws IOException {
        ensureFileAndPathExist(destFile);
        FileWriter writer = new FileWriter(destFile);
        writer.write(stringContent);
        writer.close();
    }
View Full Code Here

                            model.delete();
                        }
                        model.createNewFile();
                       
                        // now print out the class details by package
                        BufferedWriter writer = new BufferedWriter(new FileWriter(model));
                        DataModelUtils.writeImage(m_packageDirectory, writer);
                        writer.close();
                       
                    }
                } else {
View Full Code Here

        final File oldFile = new File(configDirStr + "frost.ini.old");
        final File bakFile = new File(configDirStr + "frost.ini.bak");

        final PrintWriter settingsWriter;
        try {
            settingsWriter = new PrintWriter(new FileWriter(newFile));
        } catch (final IOException exception) {
            logger.log(Level.SEVERE, "Exception thrown in writeSettingsFile()", exception);
            return false;
        }
View Full Code Here

    setModified(false);

    logger.trace("Writting properties");

    FileWriter fout = new FileWriter(propertiesFile);
    PrintWriter out = new PrintWriter(fout);

    Set<String> set = values.keySet();
    List<String> list = new LinkedList<String>(set);
    Collections.sort(list);

    int lineno = 1;
    for (String k: list) {

      boolean s = (Boolean) storeFlags.get(k);
      if (s == false) {
        continue;
      }

      List<String> v = values.get(k);

      /* Write out the comment ahead of the key */
      String c[] = getDescription(k).trim().split("\n");

      if (c.length != 0) {
        out.println(""); // Extra empty line
      }

      for (int i = 0; i < c.length; i++) {
        out.println("# " + c[i]);
        lineno ++;
      }

      /* Write out the property=value pair */

      for (String sv: v) {
        out.println(k + "=" + sv);
        lineno ++;

      }
    }

    fout.close();
  }
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.