Package net.fortuna.ical4j.data

Examples of net.fortuna.ical4j.data.CalendarBuilder


     * @throws ParserException
     * @throws GenericEntityException
     * @throws GenericServiceException
     */
    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


        String output = tester.response.getOutputAsString();
        assertThat(output, is(notNullValue()));
        Reader reader = null;
        try {
            reader = new StringReader(output);
            CalendarBuilder builder = new CalendarBuilder();
            Calendar calendar = builder.build(reader);
            assertThat(calendar, is(notNullValue()));
            assertThat(
                calendar.getProperty("PRODID").getValue(),
                is("nico2ical"));
            assertThat(calendar.getProperty("VERSION").getValue(), is("2.0"));
View Full Code Here

        String output = tester.response.getOutputAsString();
        assertThat(output, is(notNullValue()));
        Reader reader = null;
        try {
            reader = new StringReader(output);
            CalendarBuilder builder = new CalendarBuilder();
            Calendar calendar = builder.build(reader);
            assertThat(calendar, is(notNullValue()));
            assertThat(
                calendar.getProperty("PRODID").getValue(),
                is("nico2ical"));
            assertThat(calendar.getProperty("VERSION").getValue(), is("2.0"));
View Full Code Here

        String output = tester.response.getOutputAsString();
        assertThat(output, is(notNullValue()));
        Reader reader = null;
        try {
            reader = new StringReader(output);
            CalendarBuilder builder = new CalendarBuilder();
            Calendar calendar = builder.build(reader);
            assertThat(calendar, is(notNullValue()));
            assertThat(
                calendar.getProperty("PRODID").getValue(),
                is("nico2ical"));
            assertThat(calendar.getProperty("VERSION").getValue(), is("2.0"));
View Full Code Here

        String output = tester.response.getOutputAsString();
        assertThat(output, is(notNullValue()));
        Reader reader = null;
        try {
            reader = new StringReader(output);
            CalendarBuilder builder = new CalendarBuilder();
            Calendar calendar = builder.build(reader);
            assertThat(calendar, is(notNullValue()));
            assertThat(
                calendar.getProperty("PRODID").getValue(),
                is("nico2ical"));
            assertThat(calendar.getProperty("VERSION").getValue(), is("2.0"));
View Full Code Here

        String output = tester.response.getOutputAsString();
        assertThat(output, is(notNullValue()));
        Reader reader = null;
        try {
            reader = new StringReader(output);
            CalendarBuilder builder = new CalendarBuilder();
            Calendar calendar = builder.build(reader);
            assertThat(calendar, is(notNullValue()));
            assertThat(
                calendar.getProperty("PRODID").getValue(),
                is("nico2ical"));
            assertThat(calendar.getProperty("VERSION").getValue(), is("2.0"));
View Full Code Here

        assertThat(tester.getDestinationPath(), is(nullValue()));
        String output1 = tester.response.getOutputAsString();
        Calendar calendar1 = null;
        try {
            Reader reader = new StringReader(output1);
            CalendarBuilder builder = new CalendarBuilder();
            calendar1 = builder.build(reader);
        } catch (IOException e) {
            fail(e.getMessage());
        } catch (ParserException e) {
            fail(e.getMessage());
        }

        // 取得した内容がキャッシュにも保存されている。
        Object cache = Memcache.get(memcacheKey);
        assertThat(output1, is(instanceOf(String.class)));
        Calendar calendarCache = null;
        try {
            Reader reader = new StringReader((String) cache);
            CalendarBuilder builder = new CalendarBuilder();
            calendarCache = builder.build(reader);
        } catch (IOException e) {
            fail(e.getMessage());
        } catch (ParserException e) {
            fail(e.getMessage());
        }
        assertThat(calendar1, is(calendarCache));

        // 同じ条件でもう一度コントローラーを呼ぶと、キャッシュに保存している内容を取得する。
        tester.param("startWeek", 1);
        tester.param("keyword", "テスト 説明 文");
        tester.start("/Calendar");
        CalendarController controller2 = tester.getController();
        assertThat(controller2, is(notNullValue()));
        assertThat(tester.isRedirect(), is(false));
        assertThat(tester.response.getStatus(), is(200));
        assertThat(tester.getDestinationPath(), is(nullValue()));
        String output2 = tester.response.getOutputAsString();
        Calendar calendar2 = null;
        try {
            Reader reader = new StringReader(output2);
            CalendarBuilder builder = new CalendarBuilder();
            calendar2 = builder.build(reader);
        } catch (IOException e) {
            fail(e.getMessage());
        } catch (ParserException e) {
            fail(e.getMessage());
        }
View Full Code Here

    Map<Integer, Date> holidays = new HashMap<Integer, Date>();
   
    if(_holidayCalendar == null) {
      InputStream fin = WalkerState.class.getResourceAsStream(_calendarFileName);
      try {
        _holidayCalendar = new CalendarBuilder().build(fin);
       
      } catch (IOException e) {
        _logger.severe("Couln't open " + _calendarFileName);
        return holidays;
       
View Full Code Here

    public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
        Preconditions.checkNotNull(baseURI);

        setBaseURI(baseURI);
        try {
            parseCalendar(new CalendarBuilder().build(in));
        } catch (ParserException e) {
            throw new RDFParseException(e);
        }
    }
View Full Code Here

    public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
        Preconditions.checkNotNull(baseURI);

        setBaseURI(baseURI);
        try {
            parseCalendar(new CalendarBuilder().build(reader));
        } catch (ParserException e) {
            throw new RDFParseException(e);
        }
    }
View Full Code Here

TOP

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

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.