updated for new org.ibex.js
[org.ibex.mail.git] / src / org / ibex / mail / MIME.java
index abcb71f..67ee72d 100644 (file)
@@ -7,6 +7,7 @@ import org.ibex.crypto.*;
 import org.ibex.util.*;
 import org.ibex.mail.protocol.*;
 import org.ibex.io.*;
+import org.ibex.js.*;
 import java.util.*;
 import java.net.*;
 import java.io.*;
@@ -166,7 +167,7 @@ public class MIME {
                 lines++;
             }
             if ("quoted-printable".equals(encoding)) this.body = MIME.QuotedPrintable.decode(body.toString(),false);
-            else if ("base64".equals(encoding)) this.body = new String(Base64.decode(body.toString()));
+            else if ("base64".equals(encoding)) this.body = new String(Encode.fromBase64(body.toString()));
             else this.body = body.toString();
             this.last = last;
             this.lines = lines + headers.lines;
@@ -214,11 +215,11 @@ public class MIME {
             this.raw = all.toString();
             this.lines = lines;
 
-            Enumeration e = head.keys();
+            java.util.Enumeration e = head.keys();
             boolean mime = assumeMime | (gets("mime-version") != null && gets("mime-version").trim().equals("1.0"));
             /*
-            while(e.hasMoreElements()) {
-                String k = (String)e.nextElement();
+            while(e.hasNext()) {
+                String k = (String)e.next();
                 String v = (String)head.get(k);
                 if (mime) k = MIME.RFC2047.decode(k);
                 v = uncomment(v);