Code example for FileHandler

0
 
        // %t and %p parsing can add file separator automatically 
 
        // bad directory, IOException, append 
        try { 
            new FileHandler("%t/baddir/multi%g", true);
            fail("should throw IO exception");
        } catch (IOException e) {
        } 
        File file = new File(TEMPPATH + SEP + "baddir" + SEP + "multi0");
        assertFalse(file.exists());
        try { 
            new FileHandler("%t/baddir/multi%g", false);
            fail("should throw IO exception");
        } catch (IOException e) {
        } 
        file = new File(TEMPPATH + SEP + "baddir" + SEP + "multi0");
        assertFalse(file.exists());
 
        try { 
            new FileHandler("%t/baddir/multi%g", 12, 4);