minor reformatting
[org.ibex.mail.git] / src / org / ibex / mail / MIME.java
index d395f23..c758f7c 100644 (file)
@@ -20,36 +20,37 @@ import java.io.*;
 public class MIME {
 
     public static class Part extends JSReflection implements Fountain {
-        public  final  Headers      headers;
-        public  final  ContentType  contentType;
-        private final  String       encoding;
+        public  final Headers      headers;
+        public  final ContentType  contentType;
+        private final String       encoding;
 
         private final Fountain     all;
         private final Fountain     body;
 
-        public Stream getStream() { return all.getStream(); }
-        public int getNumLines()  { return all.getNumLines(); }
-        public int getLength()    { return all.getLength(); }
+        public Stream getStream()   { return all.getStream(); }
+        public int getNumLines()    { return all.getNumLines(); }
+        public long getLength()     { return all.getLength(); }
         public Fountain getBody()   { return body; }
 
         private class BodyFountain implements Fountain {
             public int getNumLines()  { return Stream.countLines(getStream()); }
-            public int getLength()    { return Part.this.getLength() - headers.getLength() - 2; }
+            public long getLength()   { return Part.this.getLength() - headers.getLength() - 2 /*FIXME: correct?*/; }
             public Stream getStream() {
                 return /*
                          "quoted-printable".equals(encoding) ? Encode.QuotedPrintable.decode(body.toString(),false) :
                          "base64".equals(encoding)           ? Encode.fromBase64(body.toString()) :
                        */
-                    Headers.skip(all.getStream());
+                    Headers.Original.skip(all.getStream());
             }
         }
 
         public Part(Fountain all) {
-            this.headers     = new Headers(all.getStream());
+            this.headers     = new Headers.Original(all.getStream());
             String ctype     = headers.get("content-type");
             this.encoding    = headers.get("content-transfer-encoding");
             if (!(encoding == null || encoding.equals("7bit") || encoding.equals("8bit") || encoding.equals("binary") ||
                   encoding.equals("quoted-printable") || encoding.equals("base64"))) {
+                // FIXME: "7BIT" is popular
                 Log.warn(MIME.class, "unknown TransferEncoding \"" + encoding + "\"");
                 ctype = "application/octet-stream";
             }