/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures * @see #getRecipients */ public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures * @see #getRecipients */ @Override public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }
/** * Convert the given array of NewsAddress objects into * a comma separated sequence of address strings. The * resulting string contains only US-ASCII characters, and * hence is mail-safe. * * @param addresses array of NewsAddress objects * @exception ClassCastException, if any address object in the * given array is not a NewsAddress objects. Note * that this is a RuntimeException. * @return comma separated address strings */ public static String toString(Address[] addresses) { if (addresses == null || addresses.length == 0) return null; StringBuffer s = new StringBuffer(((NewsAddress)addresses[0]).toString()); for (int i = 1; i < addresses.length; i++) s.append(",").append(((NewsAddress)addresses[i]).toString()); return s.toString(); }
/** * Convert the given array of NewsAddress objects into * a comma separated sequence of address strings. The * resulting string contains only US-ASCII characters, and * hence is mail-safe. * * @param addresses array of NewsAddress objects * @exception ClassCastException, if any address object in the * given array is not a NewsAddress objects. Note * that this is a RuntimeException. * @return comma separated address strings */ public static String toString(Address[] addresses) { if (addresses == null || addresses.length == 0) return null; StringBuffer s = new StringBuffer(((NewsAddress)addresses[0]).toString()); for (int i = 1; i < addresses.length; i++) s.append(",").append(((NewsAddress)addresses[i]).toString()); return s.toString(); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException */ public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException */ public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Add the given addresses to the specified recipient type. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public void addRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { String s = NewsAddress.toString(addresses); if (s != null) addHeader("Newsgroups", s); } else addAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures * @see #getRecipients */ @Override public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures * @see #getRecipients */ @Override public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException * @see #getRecipients */ public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }
/** * Set the specified recipient type to the given addresses. * If the address parameter is <code>null</code>, the corresponding * recipient field is removed. * * @param type Recipient type * @param addresses Addresses * @exception IllegalWriteException if the underlying * implementation does not support modification * of existing values * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures * @see #getRecipients */ @Override public void setRecipients(Message.RecipientType type, Address[] addresses) throws MessagingException { if (type == RecipientType.NEWSGROUPS) { if (addresses == null || addresses.length == 0) removeHeader("Newsgroups"); else setHeader("Newsgroups", NewsAddress.toString(addresses)); } else setAddressHeader(getHeaderName(type), addresses); }