use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.
the class CustomColumnManager method exportColumns.
public void exportColumns(File dest) throws IOException {
BufferedWriter out = new BufferedWriter(new RobustFileWriter(dest, "UTF-8"));
projectColumnSpecs.getAsXML(out);
out.close();
}
use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.
the class WBSLibrary method save.
public void save() throws IOException {
try {
if (file == null)
throw new IOException("Attempting to save nonfile library");
RobustFileWriter out = new RobustFileWriter(file, "UTF-8");
out.write("<" + getRootTag() + " ");
out.write(PROCESS_NAME_ATTR + "='" + XMLUtils.escapeAttribute(processName) + "' ");
out.write(PROCESS_VERSION_ATTR + "='" + XMLUtils.escapeAttribute(processVersion) + "' ");
out.write(LIBRARY_ID_ATTR + "='" + XMLUtils.escapeAttribute(getLibraryID()) + "' ");
out.write(EXPORT_TIMESTAMP_ATTR + "='" + XMLUtils.saveDate(new Date()) + "'>\n");
wbs.getAsXML(out);
out.write("</" + getRootTag() + ">");
out.close();
} catch (IOException ioe) {
throw ioe;
} catch (Exception e) {
IOException ioe = new IOException("Unable to save library.");
ioe.initCause(e);
throw ioe;
}
}
use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.
the class DefectLog method saveAsTabDelimited.
private boolean saveAsTabDelimited(Defect[] defects) {
boolean savedSuccessfully = true;
try {
File defectFile = new File(defectLogFilename);
Writer out = new BufferedWriter(new RobustFileWriter(defectFile));
// write the defect info
String newLine = System.getProperty("line.separator");
if (defects != null)
for (int i = 0; i < defects.length; i++) if (defects[i] != null) {
if (defects[i].needsXmlSaveFormat())
savedSuccessfully = false;
out.write(defects[i].toString());
out.write(newLine);
}
out.close();
} catch (IOException e) {
System.out.println("IOException: " + e);
}
;
return savedSuccessfully;
}
use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.
the class TimeLogModifications method save.
public synchronized boolean save() {
if (saveFile == null || Settings.isReadOnly())
return false;
try {
RobustFileWriter out = new RobustFileWriter(saveFile, "UTF-8");
Iterator entries = new IteratorConcatenator(//
new RenamingOperationsIterator(), modifications.values().iterator());
TimeLogWriter.write(out, entries);
saveFileTimestamp = saveFile.lastModified();
dirty = false;
return true;
} catch (IOException ioe) {
System.err.println("Unable to save time log modifications to file '" + saveFile + "'");
ioe.printStackTrace();
return false;
}
}
use of net.sourceforge.processdash.util.RobustFileWriter in project processdash by dtuma.
the class MigrationToolIndiv method saveDataFile.
private void saveDataFile(File dataFile, List<StringBuffer> data) throws IOException {
BufferedWriter out = new BufferedWriter(new RobustFileWriter(dataFile));
for (StringBuffer line : data) {
if (line.length() > 0) {
out.write(line.toString());
out.newLine();
}
}
out.close();
}
Aggregations