Android Open Source - mailinglistmoderator Mail Message






From Project

Back to project page mailinglistmoderator.

License

The source code is released under:

Copyright (c) 2010, Magnus Hagander All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:...

If you think the Android project mailinglistmoderator listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * MailMessage.java - This class holds an abstract base class for implementing a mailinglist-specific
 *                    message with required identifiers and content.
 * /*  w  ww  . j  av a2s  .c o m*/
 * Copyright (C) 2010 Magnus Hagander <magnus@hagander.net>
 * 
 * This software is released under the BSD license.
 */
package net.hagander.mailinglistmoderator.backend;

/**
 * 
 * @author Magnus Hagander <magnus@hagander.net>
 * 
 *         This base class is simply a container for some common properties.
 */
public abstract class MailMessage {
  private String sender;
  private String subject;
  private String content;
  private statuslevel status = statuslevel.Defer;

  public enum statuslevel {
    Accept, Reject, Defer
  };

  public MailMessage(String sender, String subject, String content) {
    /* 
     * Create new strings to de-couple from large strings being returned
     * in regex matches. We do this here to get it in a centralized location,
     * even if it means we might duplicate once or twice too many.
     * Also, limit the length of the content to 255 bytes.
     */
    this.sender = new String(sender);
    this.subject = new String(subject);
    if (content.length() > 255)
      this.content = new String(content.substring(0,255));
    else
      this.content = new String(content);
  }

  public String getSender() {
    return sender;
  }

  public String getSubject() {
    return subject;
  }

  public String getContent() {
    return content;
  }

  public void setStatus(statuslevel status) {
    this.status = status;
  }

  public statuslevel getStatus() {
    return status;
  }
}




Java Source Code List

net.hagander.mailinglistmoderator.MailinglistModerator.java
net.hagander.mailinglistmoderator.MessageViewActivity.java
net.hagander.mailinglistmoderator.QueueListActivity.java
net.hagander.mailinglistmoderator.ServerEditor.java
net.hagander.mailinglistmoderator.backend.ListServer.java
net.hagander.mailinglistmoderator.backend.MailMessage.java
net.hagander.mailinglistmoderator.backend.providers.Dummy.java
net.hagander.mailinglistmoderator.backend.providers.Mailman.java
net.hagander.mailinglistmoderator.backend.providers.Majordomo2.java
net.hagander.mailinglistmoderator.backend.providers.Unconfigured.java
net.hagander.mailinglistmoderator.glue.ListServerAdapter.java
net.hagander.mailinglistmoderator.glue.MailMessageAdapter.java
net.hagander.mailinglistmoderator.preferences.SSLCertDialogPreference.java