Skip to content

Commit

Permalink
Add an accessor to Message's properties and fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
lolo101 committed Aug 5, 2024
1 parent eda2459 commit 366d0d7
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions msgparser/src/main/java/com/auxilii/msgparser/Message.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.regex.Matcher;
Expand All @@ -59,7 +58,7 @@ public class Message {
public static final DateTimeFormatter DATE_TIME_FORMATTER = new DateTimeFormatterBuilder().appendPattern("[EEE, ]d MMM y HH:mm[:ss] Z").toFormatter(Locale.US);

/**
* The message Id.
* The message ID.
*/
private String messageId;
/**
Expand All @@ -70,7 +69,7 @@ public class Message {
private String fromSMTPAddress;

/**
* The name part of the From: mail address
* The name part of the "From:" mail address
*/
private String fromName;
private String fromAddressType;
Expand Down Expand Up @@ -121,7 +120,7 @@ public class Message {
/**
* Contains all properties that are not covered by the special properties.
*/
private final Collection<Property> properties = new ArrayList<>();
private final List<Property> properties = new ArrayList<>();
/**
* A list containing all recipients for this message (which can be set in the
* 'to:', 'cc:' and 'bcc:' field, respectively).
Expand Down Expand Up @@ -201,6 +200,13 @@ void setProperty(Property property) {
}
}

/**
* The properties in the order they were added to the message.
*/
public List<Property> getProperties() {
return properties;
}

/**
* Provides a short representation of this .msg object.
*
Expand Down Expand Up @@ -485,7 +491,7 @@ private static ZonedDateTime toDate(String dateValue) {
try {
return ZonedDateTime.from(DATE_TIME_FORMATTER.parse(dateValue));
} catch (Exception e) {
LOGGER.info("Could not parse date " + dateValue, e);
LOGGER.info("Could not parse date {}", dateValue, e);
return null;
}
}
Expand Down

0 comments on commit 366d0d7

Please sign in to comment.