Package net.fortuna.ical4j.data

Examples of net.fortuna.ical4j.data.CalendarBuilder.build()


    }
   
    CalendarBuilder builder = new CalendarBuilder();
    Calendar calendar = null;
    try {
      calendar = builder.build(in);
    } catch (Exception e) {
      throw new OLATRuntimeException("Error parsing calendar file.", e);
    } finally {
      if (in != null)
        FileUtils.closeSafely(in);
View Full Code Here


  public Kalendar buildKalendarFrom(String calendarContent, String calType, String calId) {
    Kalendar kalendar = null;
    BufferedReader reader = new BufferedReader(new StringReader(calendarContent));
    CalendarBuilder builder = new CalendarBuilder();
    try {
      Calendar calendar = builder.build(reader);
      kalendar = createKalendar(calType, calId, calendar);
    } catch (Exception e) {
      throw new OLATRuntimeException("Error parsing calendar file.", e);
    } finally {
      if (reader != null) {
View Full Code Here

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));

        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));

        ComponentList list = calendar.getComponents(Component.VEVENT);
        List<String> uids = new ArrayList<String>();
        for (Object obj : list) {
            VEvent vEvent = (VEvent) obj;
View Full Code Here

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));

        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));

        ComponentList list = calendar.getComponents(Component.VEVENT);
        List<String> uids = new ArrayList<String>();
        for (Object obj : list) {
            VEvent vEvent = (VEvent) obj;
View Full Code Here

        assertThat(Helpers.contentType(proxy.getResult()), is("text/calendar"));
        assertThat(Helpers.charset(proxy.getResult()), is("utf-8"));
        assertThat(Helpers.header("Content-Disposition", proxy.getResult()), is("inline"));

        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(new ByteArrayInputStream(Helpers.contentAsBytes(proxy.getResult())));

        ComponentList list = calendar.getComponents(Component.VEVENT);
        List<String> uids = new ArrayList<String>();
        for (Object obj : list) {
            VEvent vEvent = (VEvent) obj;
View Full Code Here

        } else {
            Debug.logVerbose("iCalendar Data found, using saved Calendar", module);
            StringReader reader = new StringReader(iCalData);
            CalendarBuilder builder = new CalendarBuilder();
            try {
                calendar = builder.build(reader);
                newCalendar = false;
            } catch (Exception e) {
                Debug.logError(e, "Error while parsing saved iCalendar, creating new iCalendar: ", module);
                calendar = new Calendar();
            }
View Full Code Here

     */
    public static ResponseProperties storeCalendar(InputStream is, Map<String, Object> context) throws IOException, ParserException, GenericEntityException, GenericServiceException {
        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = null;
        try {
            calendar = builder.build(is);
        } finally {
            if (is != null) {
                is.close();
            }
        }
View Full Code Here

          if (disposition != null && disposition.equals(Part.ATTACHMENT)) {
            if (part.getFileName().equals("invite.ics")) {
              log.info("Found an iCal attachement. Filename: " + part.getFileName());
              CalendarBuilder builder = new CalendarBuilder();
              Calendar calendar = builder.build(part.getInputStream());
              Component event = calendar.getComponent(Component.VEVENT);
              Property startDate = event.getProperty(Property.DTSTART);
              Property endDate = event.getProperty(Property.DTEND);
              Property attendee = null;
              String login = null;
View Full Code Here

        } else {
            Debug.logVerbose("iCalendar Data found, using saved Calendar", module);
            StringReader reader = new StringReader(iCalData);
            CalendarBuilder builder = new CalendarBuilder();
            try {
                calendar = builder.build(reader);
                newCalendar = false;
            } catch (Exception e) {
                Debug.logError(e, "Error while parsing saved iCalendar, creating new iCalendar: ", module);
                calendar = new Calendar();
            }
View Full Code Here

     */
    public static ResponseProperties storeCalendar(InputStream is, Map<String, Object> context) throws IOException, ParserException, GenericEntityException, GenericServiceException {
        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = null;
        try {
            calendar = builder.build(is);
        } finally {
            if (is != null) {
                is.close();
            }
        }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.