Пример #1
0
 private Enumeration<String> enumerateHeaderLines(boolean match, String[] names) {
   List<String> jmheaders = new ArrayList<String>();
   for (com.zimbra.common.mime.MimeHeader header : zheaders) {
     int i = 0;
     for (; i < names.length; i++) {
       if (header.getName().equalsIgnoreCase(names[i])) {
         break;
       }
     }
     if (match == (i != names.length)) {
       jmheaders.add(new String(header.getRawHeader()).trim());
     }
   }
   return new IteratorEnumeration<String>(jmheaders);
 }
Пример #2
0
 @Override
 public String[] getHeader(String name) {
   if (ZPARSER) {
     List<com.zimbra.common.mime.MimeHeader> matches = zheaders.getAll(name);
     if (matches == null || matches.isEmpty()) {
       return null;
     } else {
       int i = 0;
       String[] values = new String[matches.size()];
       for (com.zimbra.common.mime.MimeHeader header : matches) {
         values[i++] = header.getEncodedValue(defaultCharset);
       }
       return values;
     }
   } else {
     return super.getHeader(name);
   }
 }
Пример #3
0
 private Enumeration<Header> enumerateHeaders(boolean match, String[] names) {
   if (names == null) {
     names = NO_HEADERS;
   }
   List<InternetHeader> jmheaders = new ArrayList<InternetHeader>();
   for (com.zimbra.common.mime.MimeHeader header : zheaders) {
     int i = 0;
     for (; i < names.length; i++) {
       if (header.getName().equalsIgnoreCase(names[i])) {
         break;
       }
     }
     if (match == (i != names.length)) {
       jmheaders.add(new InternetHeader(header.getName(), header.getValue(defaultCharset)));
     }
   }
   return new IteratorEnumeration<Header>(jmheaders);
 }