public Project(User creator) { setLabel(INIT_LABEL + " " + DateAndTime.now()); addParticipant(creator); addAdmin(creator); addProductOwner(creator); addScrumMaster(creator); addTeamMember(creator); setLastOpenedDateAndTime(DateAndTime.now()); }
public static DateAndTime getSentTime(Message msg) { Date date; try { date = msg.getSentDate(); } catch (MessagingException ex) { throw new RuntimeException(ex); } if (date == null) return null; DateAndTime result = new DateAndTime(date); if (result.isFuture()) result = DateAndTime.now(); return result; }
public List<ProjectEvent> getLatestProjectEvents(int min) { List<ProjectEvent> events = getProjectEvents(); Collections.sort(events, ProjectEvent.DATE_AND_TIME_COMPARATOR); DateAndTime deadline = new DateAndTime(Date.today().prevDay(), Time.now()); List<ProjectEvent> ret = new ArrayList<ProjectEvent>(); int count = 0; for (ProjectEvent event : events) { ret.add(event); count++; DateAndTime dateAndTime = event.getDateAndTime(); if (count > min && dateAndTime.isBefore(deadline)) break; } return ret; }
public static void main(String[] args) throws Throwable { Log.setDebugEnabled(true); Sys.setFileEncoding(IO.UTF_8); Session session = createSmtpSession( "mail.servisto.de", null, false, LoginPanel.showDialog( null, "Servisto SMTP", new File("runtimedata/servisto-smtp.properties"))); // Session session = createSmtpSession("smtp.gmail.com", 587, true, // LoginPanel.showDialog(null, "GMail SMTP", new File("runtimedata/gmail-smtp.properties"))); String html = "<h1>Überschrift</h1><p>paragraph <strong>strong</strong></p>"; String subject = "test html " + DateAndTime.now(); String from = "*****@*****.**"; String to = "[email protected], [email protected]"; Attachment[] attachments = createAttachments(new File("/home/witek/inbox/Fehler.png")); MimeMessage message = createMessage(session, subject, html, null, from, to, attachments); sendSmtpMessage(session, message); // sendSmtpMessage( // session, // createMessage(session, "test plain " + DateAndTime.now(), null, "plain", "*****@*****.**", // "[email protected], [email protected]")); // Message msg = createTextMessage(createDummySession(), "aaa" + Str.UE + "aaa", "aaa" + Str.UE // + // "aaa", // "*****@*****.**", "*****@*****.**"); // OutputStream out = new FileOutputStream("g:/inbox/email-test.msg"); // writeMessage(msg, out); // out.close(); // Store store = getStore("imaps", "imap.googlemail.com", "*****@*****.**", // "xxx"); // try { // Folder folder = store.getFolder("INBOX"); // folder.open(Folder.READ_ONLY); // LOG.debug("folder:", folder.getName()); // for (Message message : folder.getMessages()) { // LOG.debug(" message:", getSubject(message), "->", getContentAsText(message)); // } // } finally { // closeStore(store); // } System.exit(0); }
@Override public void ensureIntegrity() { super.ensureIntegrity(); updateNumber(); if (!isDateAndTimeSet()) setDateAndTime(DateAndTime.now()); }
public UserMessage(String type, String text) { this.type = type; this.text = text; this.dateAndTime = DateAndTime.now(); }
private void updateActionTime() { actionTime = DateAndTime.now().addMinutes(10); }