Search in sources :

Example 21 with RobustFileWriter

use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.

the class ChangeHistory method write.

public void write(File f) throws IOException {
    // if we were given a directory, write to the change history file there
    if (f.isDirectory())
        f = new File(f, WBSFilenameConstants.CHANGE_HISTORY_FILE);
    // write the XML to the file
    BufferedWriter out = new BufferedWriter(new RobustFileWriter(f, "utf-8"));
    getAsXML(out);
    out.flush();
    out.close();
}
Also used : RobustFileWriter(net.sourceforge.processdash.util.RobustFileWriter) File(java.io.File) BufferedWriter(java.io.BufferedWriter)

Example 22 with RobustFileWriter

use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.

the class MigrationToolTeam method migrateDatafileContents.

private void migrateDatafileContents(File dataFile) throws IOException {
    StringBuffer contents = slurpFile(dataFile);
    StringUtils.findAndReplace(contents, "/team_root_dataFile.txt>", "/team2_root_dataFile.txt>");
    String newline = System.getProperty("line.separator");
    contents.append(newline).append("Team_Project_Migration_Complete==1").append(newline);
    Writer out = new BufferedWriter(new RobustFileWriter(dataFile));
    out.write(contents.toString());
    out.close();
}
Also used : RobustFileWriter(net.sourceforge.processdash.util.RobustFileWriter) BufferedWriter(java.io.BufferedWriter) RobustFileWriter(net.sourceforge.processdash.util.RobustFileWriter) Writer(java.io.Writer) BufferedWriter(java.io.BufferedWriter)

Aggregations

RobustFileWriter (net.sourceforge.processdash.util.RobustFileWriter)22 BufferedWriter (java.io.BufferedWriter)17 File (java.io.File)11 IOException (java.io.IOException)11 Writer (java.io.Writer)6 InputStreamReader (java.io.InputStreamReader)2 Iterator (java.util.Iterator)2 BufferedReader (java.io.BufferedReader)1 FileInputStream (java.io.FileInputStream)1 PrintWriter (java.io.PrintWriter)1 Reader (java.io.Reader)1 MalformedURLException (java.net.MalformedURLException)1 PrivilegedAction (java.security.PrivilegedAction)1 Date (java.util.Date)1 Enumeration (java.util.Enumeration)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 DefaultTableColumnModel (javax.swing.table.DefaultTableColumnModel)1