0

URLで取得したVCalendarがあります:

PRODID: test_online
VERSION: 1.0
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY: It's a test
DESCRIPTION: Test an vcalendar parser
LOCATION:
DTSTART: 11/6/2011 3:00:00 PM
DTEND: 11/10/2011 11:59:00 PM
CATEGORIES: Other tests
END:VEVENT
END:VCALENDAR

文字列を分割する以外に、そのような vcalendar を解析する方法はありますか? Ical4j を試してみましたが、常に次のエラーが発生しました。

The exception contained within MappableContainerException could not be mapped to a    response, re-throwing to the HTTP container

私のコードは次のとおりです。

StringReader s = new StringReader(vcal);
CalendarBuilder builder = new CalendarBuilder();
Calendar c = builder.build(s);
System.out.println(c.toString());

誰でも私を助けることができますか?

よろしくお願いします!

4

2 に答える 2

0

Unfortunately iCal4j only support iCalendar (i.e. VERSION:2.0), not vCalendar.

So for example, the dates in your example above don't conform to the iCalendar standard so it won't parse.

于 2011-11-07T11:57:32.717 に答える