public void setValue(InputStream is) { try { this.value = CalendarUtils.parseCalendar(is); } catch (ParserException e) { throw new ModelValidationException("invalid calendar: " + e.getMessage()); } catch (IOException ioe) { throw new ModelValidationException("error parsing calendar: " + ioe.getMessage()); } }
public void setValue(InputStream is) { try { this.value = CalendarUtils.parseCalendar(is); } catch (ParserException e) { throw new ModelValidationException("invalid calendar: " + e.getMessage()); } catch (IOException ioe) { throw new ModelValidationException("error parsing calendar: " + ioe.getMessage()); } }
/** * Test loading of calendars. * * @throws IOException */ public void testLoadParserException() throws IOException { try { Calendars.load(resource); fail("Should throw ParserException"); } catch (ParserException pe) { LOG.info("Caught exception: " + pe.getMessage()); } }
throw new IcalMalformedException(pe.getMessage()); } catch (final Throwable t) { throw new CalFacadeException(t);
throw new IcalMalformedException(pe.getMessage()); } catch (final Throwable t) { throw new CalFacadeException(t);
public void testRelaxedParsing() throws IOException, ParserException { try { Calendars.load(getClass().getResource("/samples/invalid/groupwise.ics")); fail("Should throw URISyntaxException"); } catch (ParserException pe) { LOG.info("Caught exception: " + pe.getMessage()); } CompatibilityHints.setHintEnabled(CompatibilityHints.KEY_RELAXED_PARSING, true); Calendar calendar = Calendars.load(getClass().getResource("/samples/invalid/groupwise.ics")); Attendee attendee = (Attendee) calendar.getComponent(Component.VEVENT).getProperty(Property.ATTENDEE); assertNotNull(attendee.getCalAddress()); } }
/** * Test the accuracy of parser exception line number. * * @throws IOException */ public void testParserException() throws IOException { try { Calendars.load(resource); fail("Should throw ParserException: [" + resource + "]"); } catch (ParserException pe) { LOG.info(pe.getMessage()); assertEquals(expectedErrorLineNo, pe.getLineNo()); } }
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Failed to parse calendar object: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Failed to parse calendar object: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());
error(pe); throw new IcalMalformedException(pe.getMessage()); } catch (Throwable t) { throw new CalFacadeException(t);
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Calendar object not parseable: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());
throw new CosmoDavException(e); } catch (ParserException e) { throw new InvalidCalendarDataException("Calendar object not parseable: " + e.getMessage()); } catch (ValidationException e) { throw new InvalidCalendarDataException("Invalid calendar object: " + e.getMessage());