String organizerEmail, String location, String description, List<Pair<String, String>> participators) throws MessagingException, IOException { UidGenerator ug = new RandomUidGenerator();// new UidGenerator("uidGen"); Uid uid = ug.generateUid(); String content = makeICalMeetingText(uid, startTime, endTime, title, organizerName, organizerEmail,
/** * Sets the UID of the Calendar, if none exists. Otherwise, does nothing * @param calendar Calendar to which we have to add a UID to * @return The new UID that has been set. Otherwise the old one. * @throws CalDAV4JException on error finding Component. */ public static Uid setUID (net.fortuna.ical4j.model.Calendar calendar) throws CalDAV4JException { Component comp = getFirstComponent(calendar); Uid uid = (Uid) comp.getProperties().getProperty(Property.UID); if(uid == null) { RandomUidGenerator generator = new RandomUidGenerator(); uid = generator.generateUid(); comp.getProperties().add(uid); } return uid; }
/** * @return * @throws SocketException */ public static TestSuite suite() throws SocketException { TestSuite suite = new TestSuite(); VVenue vv = new VVenue(); suite.addTest(new VVenueTest("testIsCalendarComponent", vv)); suite.addTest(new VVenueTest("testValidationException", vv)); UidGenerator g = new RandomUidGenerator(); vv = new VVenue(); vv.getProperties().add(g.generateUid()); suite.addTest(new VVenueTest("testValidation", vv)); return suite; }
UidGenerator ug = new RandomUidGenerator(); Uid uid = ug.generateUid();
/** * @return * @throws SocketException */ public static TestSuite suite() throws SocketException { TestSuite suite = new TestSuite(); VAvailability a = new VAvailability(); suite.addTest(new VAvailabilityTest("testIsCalendarComponent", a)); suite.addTest(new VAvailabilityTest("testValidationException", a)); UidGenerator g = new RandomUidGenerator(); a = new VAvailability(); a.getProperties().add(g.generateUid()); a.getProperties().add(new DtStart(new DateTime())); suite.addTest(new VAvailabilityTest("testValidation", a)); return suite; }
/** * @return * @throws SocketException */ public static TestSuite suite() throws SocketException { TestSuite suite = new TestSuite(); Available a = new Available(); suite.addTest(new AvailableTest("testIsNotCalendarComponent", a)); suite.addTest(new AvailableTest("testValidationException", a)); UidGenerator g = new RandomUidGenerator(); a = new Available(); a.getProperties().add(g.generateUid()); a.getProperties().add(new DtStart(new DateTime())); a.getProperties().add(new DtStamp()); a.getProperties().add(new Duration(java.time.Period.ofWeeks(1))); suite.addTest(new AvailableTest("testValidation", a)); return suite; } }
UidGenerator uidGenerator = new RandomUidGenerator(); UidGenerator ug = new RandomUidGenerator(); Uid uid = ug.generateUid();