@Override public String getAsText() { InternetAddress value = (InternetAddress) getValue(); return (value != null ? value.toUnicodeString() : ""); }
@Override public String getAsText() { InternetAddress value = (InternetAddress) getValue(); return (value != null ? value.toUnicodeString() : ""); }
@Override public Memory unconvert(Environment env, TraceInfo trace, InternetAddress arg) throws Throwable { return StringMemory.valueOf(arg.toUnicodeString()); } }
/** * Convert the given array of InternetAddress objects into * a comma separated sequence of address strings. The * resulting string contains Unicode characters. <p> * * @param addresses array of InternetAddress objects * @exception ClassCastException if any address object in the * given array is not an InternetAddress object. Note * that this is a RuntimeException. * @return comma separated string of addresses * @since JavaMail 1.6 */ public static String toUnicodeString(Address[] addresses) { return toUnicodeString(addresses, 0); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void addAddressHeader(String name, Address[] addresses) throws MessagingException { if (addresses == null || addresses.length == 0) return; Address[] a = getAddressHeader(name); Address[] anew; if (a == null || a.length == 0) anew = addresses; else { anew = new Address[a.length + addresses.length]; System.arraycopy(a, 0, anew, 0, a.length); System.arraycopy(addresses, 0, anew, a.length, addresses.length); } String s; if (allowutf8) s = InternetAddress.toUnicodeString(anew, name.length() + 2); else s = InternetAddress.toString(anew, name.length() + 2); if (s == null) return; setHeader(name, s); }
String as = ((InternetAddress)addresses[i]).toUnicodeString(); if (MimeUtility.checkAscii(as) != MimeUtility.ALL_ASCII) { sawNonAscii = true;
/** * Check whether the address pattern specified in the constructor is * a substring of the string representation of the given Address * object. <p> * * Note that if the string representation of the given Address object * contains charset or transfer encodings, the encodings must be * accounted for, during the match process. <p> * * @param a The comparison is applied to this Address object. * @return true if the match succeeds, otherwise false. */ protected boolean match(Address a) { if (a instanceof InternetAddress) { InternetAddress ia = (InternetAddress)a; // We dont use toString() to get "a"'s String representation, // because InternetAddress.toString() returns a RFC 2047 // encoded string, which isn't what we need here. return super.match(ia.toUnicodeString()); } else return super.match(a.toString()); }
/** * Check whether the address pattern specified in the constructor is * a substring of the string representation of the given Address * object. <p> * * Note that if the string representation of the given Address object * contains charset or transfer encodings, the encodings must be * accounted for, during the match process. <p> * * @param a The comparison is applied to this Address object. * @return true if the match succeeds, otherwise false. */ protected boolean match(Address a) { if (a instanceof InternetAddress) { InternetAddress ia = (InternetAddress)a; // We dont use toString() to get "a"'s String representation, // because InternetAddress.toString() returns a RFC 2047 // encoded string, which isn't what we need here. return super.match(ia.toUnicodeString()); } else return super.match(a.toString()); }
@Override public String toUnicodeString() { return wrappedInstance.toUnicodeString(); }
/** * Convert the given array of InternetAddress objects into * a comma separated sequence of address strings. The * resulting string contains Unicode characters. <p> * * @param addresses array of InternetAddress objects * @exception ClassCastException if any address object in the * given array is not an InternetAddress object. Note * that this is a RuntimeException. * @return comma separated string of addresses * @since JavaMail 1.6 */ public static String toUnicodeString(Address[] addresses) { return toUnicodeString(addresses, 0); }
/** * Convert the given array of InternetAddress objects into * a comma separated sequence of address strings. The * resulting string contains Unicode characters. <p> * * @param addresses array of InternetAddress objects * @exception ClassCastException if any address object in the * given array is not an InternetAddress object. Note * that this is a RuntimeException. * @return comma separated string of addresses * @since JavaMail 1.6 */ public static String toUnicodeString(Address[] addresses) { return toUnicodeString(addresses, 0); }
/** * Convert the given array of InternetAddress objects into * a comma separated sequence of address strings. The * resulting string contains Unicode characters. <p> * * @param addresses array of InternetAddress objects * @exception ClassCastException if any address object in the * given array is not an InternetAddress object. Note * that this is a RuntimeException. * @return comma separated string of addresses * @since JavaMail 1.6 */ public static String toUnicodeString(Address[] addresses) { return toUnicodeString(addresses, 0); }
@Override public String getAsText() { InternetAddress value = (InternetAddress) getValue(); return (value != null ? value.toUnicodeString() : ""); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }
private void setAddressHeader(String name, Address[] addresses) throws MessagingException { String s; if (allowutf8) s = InternetAddress.toUnicodeString(addresses, name.length() + 2); else s = InternetAddress.toString(addresses, name.length() + 2); if (s == null) removeHeader(name); else setHeader(name, s); }