Package net.fortuna.ical4j.data

Examples of net.fortuna.ical4j.data.CalendarOutputter


  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);
    }
View Full Code Here


      // get the output stream
      response.setBufferSize(outputBufferSize);
      ostream = response.getOutputStream();

      // output the calendar to the stream
      CalendarOutputter calOut = new CalendarOutputter(false);
      calOut.output(icalDoc, ostream);
    } catch (ValidationException e) {
      // throw olat exception for nice logging
      Tracing.logWarn("Validation Error when generate iCal stream for path::" + request.getPathInfo(), e, this.getClass());
      DispatcherAction.sendNotFound("none", response);
    } catch (IOException e) {
View Full Code Here

      filerPath = filerPath + ".ics";
   
   
    FileOutputStream fout = new FileOutputStream(filerPath);

    CalendarOutputter outputter = new CalendarOutputter();
    outputter.output(icsCalendar, fout);
   
   
  }
View Full Code Here

   */
  //------------------------------------------------------------------------------------------
  public byte[] getIcalAsByteArray() throws Exception{
   
    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    CalendarOutputter outputter = new CalendarOutputter();
    outputter.output(icsCalendar, bout);
    return bout.toByteArray();

  }
View Full Code Here

        calendar.getComponents().add(vEvent);
    }

    public static byte[] outputCalendar(Calendar calendar) throws IOException, ValidationException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        new CalendarOutputter().output(calendar, baos);
        return baos.toByteArray();
    }
View Full Code Here

        }
    }

    public void saveICal(SemesterTimetable t) {
        FileOutputStream fout = null;
        CalendarOutputter outputter;
        String fileName, parent;
        File f;
        if (t.getOwnerName() != null && t.getSemester() != null) {
            fileName = t.getOwnerName().toLowerCase().replace(" ", "-")
                    + "_yr" + t.getAcademicYear().replace("/", "-")
                    + t.getSemester().toLowerCase().replace(" ", "-") + "_";
        } else {
            fileName = "ntu_timetable";
        }
        fileName += ".ics";
        f = new File(t.getPath());
        parent = f.getParent();
        if (!parent.endsWith(File.separator)) {
            parent += File.separator;
        }
        fileName = parent + fileName;
        try {
            fout = new FileOutputStream(fileName);
            outputter = new CalendarOutputter();
            //System.out.println(t.toICal().toString());
            outputter.output(t.toICal(), fout);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ValidationException e) {
            e.printStackTrace();
        } finally {
View Full Code Here

            if(event.getRecurrenceType() != EventVO.RecurrenceType.NONE)
                vevent.getProperties().add(getRRule(event));
            vevents.add(vevent);
        }
        icalendar.getComponents().addAll(vevents);
        CalendarOutputter calout = new CalendarOutputter();
        if(!vevents.isEmpty()) // no calendar output if there is no component
            calout.output(icalendar,out);
    }
View Full Code Here

   
   
   

    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    CalendarOutputter outputter = new CalendarOutputter();
    try {
      outputter.output(icsCalendar, bout);
      iCalMimeBody = bout.toByteArray();
     
      sendIcalMessage();
    } catch (IOException e) {
      // TODO Auto-generated catch block
View Full Code Here

    if (!filerPath.endsWith(".ics"))
      filerPath = filerPath + ".ics";

    FileOutputStream fout = new FileOutputStream(filerPath);

    CalendarOutputter outputter = new CalendarOutputter();
    outputter.output(icsCalendar, fout);

  }
View Full Code Here

   */
  // ------------------------------------------------------------------------------------------
  public byte[] getIcalAsByteArray() throws Exception {

    ByteArrayOutputStream bout = new ByteArrayOutputStream();
    CalendarOutputter outputter = new CalendarOutputter();
    outputter.output(icsCalendar, bout);
    return bout.toByteArray();

  }
View Full Code Here

TOP

Related Classes of net.fortuna.ical4j.data.CalendarOutputter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.