Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 222cd43c authored by cketti's avatar cketti
Browse files

Some code cleanup. No functional changes.

parent 5eec09d3
Loading
Loading
Loading
Loading
+9 −19
Original line number Diff line number Diff line
@@ -77,35 +77,25 @@ public class MimeBodyPart extends BodyPart {

    public String getContentType() throws MessagingException {
        String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
        if (contentType == null) {
            return "text/plain";
        } else {
            return contentType;
        }
        return (contentType == null) ? "text/plain" : contentType;
    }

    public String getDisposition() throws MessagingException {
        String contentDisposition = getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
        if (contentDisposition == null) {
            return null;
        } else {
            return contentDisposition;
        }
        return getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
    }

    public String getContentId() throws MessagingException {
        String contentId = getFirstHeader(MimeHeader.HEADER_CONTENT_ID);
        if (contentId == null) {
            return null;
        } else {
        }

        int first = contentId.indexOf('<');
        int last = contentId.lastIndexOf('>');
            if (first != -1 && last != -1) {
                return contentId.substring(first + 1, last);
            } else {
                return contentId;
            }
        }

        return (first != -1 && last != -1) ?
            contentId.substring(first + 1, last) :
            contentId;
    }

    public String getMimeType() throws MessagingException {
+2 −11
Original line number Diff line number Diff line
@@ -130,20 +130,11 @@ public class MimeMessage extends Message {
    @Override
    public String getContentType() throws MessagingException {
        String contentType = getFirstHeader(MimeHeader.HEADER_CONTENT_TYPE);
        if (contentType == null) {
            return "text/plain";
        } else {
            return contentType.toLowerCase();
        }
        return (contentType == null) ? "text/plain" : contentType.toLowerCase();
    }

    public String getDisposition() throws MessagingException {
        String contentDisposition = getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
        if (contentDisposition == null) {
            return null;
        } else {
            return contentDisposition;
        }
        return getFirstHeader(MimeHeader.HEADER_CONTENT_DISPOSITION);
    }
    public String getContentId() throws MessagingException {
        return null;