Search in sources :

Example 16 with CalendarOutputter

use of net.fortuna.ical4j.data.CalendarOutputter in project openolat by klemens.

the class ICalFileCalendarManager method writeCalendarFile.

private boolean writeCalendarFile(Calendar calendar, String calType, String calId) {
    File fKalendarFile = getCalendarFile(calType, calId);
    OutputStream os = null;
    try {
        os = new BufferedOutputStream(new FileOutputStream(fKalendarFile, false));
        CalendarOutputter calOut = new CalendarOutputter(false);
        calOut.output(calendar, os);
    } catch (Exception e) {
        return false;
    } finally {
        FileUtils.closeSafely(os);
    }
    return true;
}
Also used : BufferedOutputStream(java.io.BufferedOutputStream) OutputStream(java.io.OutputStream) FileOutputStream(java.io.FileOutputStream) FileOutputStream(java.io.FileOutputStream) CalendarOutputter(net.fortuna.ical4j.data.CalendarOutputter) File(java.io.File) BufferedOutputStream(java.io.BufferedOutputStream) URISyntaxException(java.net.URISyntaxException) ParseException(java.text.ParseException) FileNotFoundException(java.io.FileNotFoundException) OLATRuntimeException(org.olat.core.logging.OLATRuntimeException)

Aggregations

CalendarOutputter (net.fortuna.ical4j.data.CalendarOutputter)16 FileOutputStream (java.io.FileOutputStream)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)5 Calendar (net.fortuna.ical4j.model.Calendar)5 ProdId (net.fortuna.ical4j.model.property.ProdId)5 File (java.io.File)4 VEvent (net.fortuna.ical4j.model.component.VEvent)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 FileNotFoundException (java.io.FileNotFoundException)3 IOException (java.io.IOException)3 StringWriter (java.io.StringWriter)3 URISyntaxException (java.net.URISyntaxException)3 ParseException (java.text.ParseException)3 Calendar (java.util.Calendar)3 Date (java.util.Date)3 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)3 Test (org.junit.Test)3 BufferedOutputStream (java.io.BufferedOutputStream)2 InputStream (java.io.InputStream)2 OutputStream (java.io.OutputStream)2