equal
deleted
inserted
replaced
77 * |
77 * |
78 * @param name the RFC822Name string |
78 * @param name the RFC822Name string |
79 * @throws IOException if name is not valid |
79 * @throws IOException if name is not valid |
80 */ |
80 */ |
81 public void parseName(String name) throws IOException { |
81 public void parseName(String name) throws IOException { |
82 if (name == null || name.length() == 0) { |
82 if (name == null || name.isEmpty()) { |
83 throw new IOException("RFC822Name may not be null or empty"); |
83 throw new IOException("RFC822Name may not be null or empty"); |
84 } |
84 } |
85 // See if domain is a valid domain name |
85 // See if domain is a valid domain name |
86 String domain = name.substring(name.indexOf('@')+1); |
86 String domain = name.substring(name.indexOf('@')+1); |
87 if (domain.length() == 0) { |
87 if (domain.isEmpty()) { |
88 throw new IOException("RFC822Name may not end with @"); |
88 throw new IOException("RFC822Name may not end with @"); |
89 } else { |
89 } else { |
90 //An RFC822 NameConstraint could start with a ., although |
90 //An RFC822 NameConstraint could start with a ., although |
91 //a DNSName may not |
91 //a DNSName may not |
92 if (domain.startsWith(".")) { |
92 if (domain.startsWith(".")) { |