blob: 82c229f01f74f55c17e0b0dcf4e21b5ff3b419d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/*******************************************************************************
* Copyright (c) 2004, 2007 Boeing.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.framework.jdk.core.util.windows;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
public class OutlookCalendarEvent {
private final String location;
private final String event;
private final Date date;
private final DateFormat myDateFormat;
private final String startTime;
private final String endTime;
/**
* @param location - String the event location
* @param event - String the scheduled event
* @param date
* @param startTime - 0800 - 8am
* @param endTime - 1300 - 1pm
*/
public OutlookCalendarEvent(String location, String event, Date date, String startTime, String endTime) {
super();
this.location = location;
this.event = event;
this.date = date;
this.startTime = startTime;
this.endTime = endTime;
myDateFormat = new SimpleDateFormat("yyyyMMdd");
}
public String getEvent() {
return "\nBEGIN:VCALENDAR\n" +
//
"PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN\n" +
//
"VERSION:1.0\n" +
//
"BEGIN:VEVENT\n" +
//
"DTSTART:" + myDateFormat.format(date) + "T" + startTime + "00\n" +
//
"DTEND:" + myDateFormat.format(date) + "T" + endTime + "00\n" +
//
"LOCATION;ENCODING=QUOTED-PRINTABLE:" + location + "\n" +
//
"TRANSP:1\n" +
//
"DESCRIPTION;ENCODING=QUOTED-PRINTABLE:=0D=0A\n" +
//
"SUMMARY;ENCODING=QUOTED-PRINTABLE:Event:" + event + "\n" +
//
"PRIORITY:3\n" +
//
"END:VEVENT\n" +
//
"END:VCALENDAR\n";
}
}
|