From 36ef6df01837c277ece20f9a064c29f451a6e094 Mon Sep 17 00:00:00 2001 From: Jan Berkel Date: Mon, 15 Dec 2014 12:42:05 +0100 Subject: [PATCH] Remove unused method --- src/com/fsck/k9/mail/BodyPart.java | 11 ----------- src/com/fsck/k9/mail/Message.java | 15 --------------- src/com/fsck/k9/mail/Part.java | 2 -- .../fsck/k9/mail/internet/MessageExtractor.java | 16 +++++++++++++++- .../fsck/k9/mailstore/LocalMessageExtractor.java | 1 + 5 files changed, 16 insertions(+), 29 deletions(-) diff --git a/src/com/fsck/k9/mail/BodyPart.java b/src/com/fsck/k9/mail/BodyPart.java index 84e4324f5..884b03ae1 100644 --- a/src/com/fsck/k9/mail/BodyPart.java +++ b/src/com/fsck/k9/mail/BodyPart.java @@ -17,17 +17,6 @@ public abstract class BodyPart implements Part { public abstract void setEncoding(String encoding) throws MessagingException; - @Override - public String getContentDisposition() { - try { - String disposition = getDisposition(); - if (disposition != null) { - return MimeUtility.getHeaderParameter(disposition, null); - } - } catch (MessagingException e) { /* ignore */ } - return null; - } - @Override public String getText() { return MessageExtractor.getTextFromPart(this); diff --git a/src/com/fsck/k9/mail/Message.java b/src/com/fsck/k9/mail/Message.java index f48eaf559..c1b4a09a5 100644 --- a/src/com/fsck/k9/mail/Message.java +++ b/src/com/fsck/k9/mail/Message.java @@ -270,21 +270,6 @@ public abstract class Message implements Part, CompositeBody { @Override public abstract Message clone(); - /** - * Get the value of the {@code Content-Disposition} header. - * @return The value of the {@code Content-Disposition} header if available. {@code null}, otherwise. - */ - public String getContentDisposition() { - try { - String disposition = getDisposition(); - if (disposition != null) { - return MimeUtility.getHeaderParameter(disposition, null); - } - } - catch (MessagingException e) { /* ignore */ } - return null; - } - @Override public String getText() { return MessageExtractor.getTextFromPart(this); diff --git a/src/com/fsck/k9/mail/Part.java b/src/com/fsck/k9/mail/Part.java index c890cd56e..bcf5dcc5e 100644 --- a/src/com/fsck/k9/mail/Part.java +++ b/src/com/fsck/k9/mail/Part.java @@ -17,8 +17,6 @@ public interface Part { String getDisposition() throws MessagingException; - String getContentDisposition(); - String getContentId() throws MessagingException; String[] getHeader(String name) throws MessagingException; diff --git a/src/com/fsck/k9/mail/internet/MessageExtractor.java b/src/com/fsck/k9/mail/internet/MessageExtractor.java index 5fedd3d28..2f21763ed 100644 --- a/src/com/fsck/k9/mail/internet/MessageExtractor.java +++ b/src/com/fsck/k9/mail/internet/MessageExtractor.java @@ -25,6 +25,8 @@ import static com.fsck.k9.mail.internet.Viewable.Alternative; import static com.fsck.k9.mail.internet.Viewable.Textual; public class MessageExtractor { + private MessageExtractor() {} + public static String getTextFromPart(Part part) { try { if ((part != null) && (part.getBody() != null)) { @@ -157,7 +159,7 @@ public class MessageExtractor { } } } else if (body instanceof Message && - !("attachment".equalsIgnoreCase(part.getContentDisposition()))) { + !("attachment".equalsIgnoreCase(getContentDisposition(part)))) { /* * We only care about message/rfc822 parts whose Content-Disposition header has a value * other than "attachment". @@ -407,4 +409,16 @@ public class MessageExtractor { return false; } } + + + + public static String getContentDisposition(Part part) { + try { + String disposition = part.getDisposition(); + if (disposition != null) { + return MimeUtility.getHeaderParameter(disposition, null); + } + } catch (MessagingException e) { /* ignore */ } + return null; + } } diff --git a/src/com/fsck/k9/mailstore/LocalMessageExtractor.java b/src/com/fsck/k9/mailstore/LocalMessageExtractor.java index 546c1f62d..f0e11902b 100644 --- a/src/com/fsck/k9/mailstore/LocalMessageExtractor.java +++ b/src/com/fsck/k9/mailstore/LocalMessageExtractor.java @@ -29,6 +29,7 @@ class LocalMessageExtractor { private static final String FILENAME_SUFFIX = " "; private static final int FILENAME_SUFFIX_LENGTH = FILENAME_SUFFIX.length(); + private LocalMessageExtractor() {} /** * Extract the viewable textual parts of a message and return the rest as attachments. *