1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

Remove unused method

This commit is contained in:
Jan Berkel 2014-12-15 12:42:05 +01:00
parent 7d6e6b8abe
commit 36ef6df018
5 changed files with 16 additions and 29 deletions

View File

@ -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);

View File

@ -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);

View File

@ -17,8 +17,6 @@ public interface Part {
String getDisposition() throws MessagingException;
String getContentDisposition();
String getContentId() throws MessagingException;
String[] getHeader(String name) throws MessagingException;

View File

@ -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;
}
}

View File

@ -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.
*