Search in sources :

Example 16 with RobustFileOutputStream

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

the class FilePersistenceService method save.

public OutputStream save(String qualifier, String filename) throws IOException {
    if (Settings.isReadOnly())
        return null;
    // see if our qualifier matches the specified qualifier.
    if (this.qualifier != null && !this.qualifier.equalsIgnoreCase(qualifier))
        return null;
    // abort.
    if (!baseDirectory.isDirectory() && !baseDirectory.mkdirs())
        return null;
    File f = getFile(filename);
    RobustFileOutputStream out = new RobustFileOutputStream(f);
    return out;
}
Also used : RobustFileOutputStream(net.sourceforge.processdash.util.RobustFileOutputStream) File(java.io.File)

Example 17 with RobustFileOutputStream

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

the class MigrationToolIndiv method writeHierarchyFile.

private void writeHierarchyFile() throws IOException {
    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new RobustFileOutputStream(file("state")), "UTF-8"));
    out.write(XMLUtils.getAsText(hier));
    out.close();
}
Also used : RobustFileOutputStream(net.sourceforge.processdash.util.RobustFileOutputStream) OutputStreamWriter(java.io.OutputStreamWriter) BufferedWriter(java.io.BufferedWriter)

Aggregations

RobustFileOutputStream (net.sourceforge.processdash.util.RobustFileOutputStream)17 File (java.io.File)10 IOException (java.io.IOException)9 BufferedOutputStream (java.io.BufferedOutputStream)8 OutputStream (java.io.OutputStream)7 XmlSerializer (org.xmlpull.v1.XmlSerializer)5 OutputStreamWriter (java.io.OutputStreamWriter)3 BufferedWriter (java.io.BufferedWriter)2 Iterator (java.util.Iterator)2 ZipEntry (java.util.zip.ZipEntry)2 ZipFile (java.util.zip.ZipFile)2 ZipOutputStream (java.util.zip.ZipOutputStream)2 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 InputStream (java.io.InputStream)1 Writer (java.io.Writer)1 ArrayList (java.util.ArrayList)1 ConcurrentModificationException (java.util.ConcurrentModificationException)1