001package edu.pdx.cs410J.grader;
002
003import jakarta.mail.Message;
004import jakarta.mail.MessagingException;
005
006import java.io.InputStream;
007
008public interface EmailAttachmentProcessor {
009  void processAttachment(Message message, String fileName, InputStream inputStream, String contentType);
010
011  Iterable<? extends String> getSupportedContentTypes();
012
013  default boolean hasSupportedContentType(Message message) throws MessagingException {
014    for (String supported : getSupportedContentTypes()) {
015      if (message.isMimeType(supported)) {
016        return true;
017      }
018    }
019
020    return false;
021  }
022}