Robert Burrell Donkin ha scritto:
> http://svn.apache.org/repos/asf/james/mime4j/trunk/src/main/java/org/apache/james/mime4j/Cursor.java
> 
> contains a first cut at a cursor API
> 
> comments and improvements welcomed :-)
> 
> a few particular points:
> 
> 1. exception handling strategy - opted to through IOExceptions almost
> everywhere. when required, custom subclasses will be created.

+1

> 2. there are currently some methods which seem like they may be
> stateful. for example, it's not certain how to interpret
> advanceToBoundary if boundary has not previously been set. the
> question is whether to specify reasonable behaviour (for example, when
> the boundary has not been set, advancedToBoundary should do nothing)
> or insist that exceptions be thrown.

I'd go for an exception. But I don't know the code enough to understand
how likely this will happen and how likely this is a programmer error or
something else.

> 3. the API uses a string to represent the MIME boundary. i'm not sure
> that this is right. AIUI (hopefully people will correct me if i'm
> wrong) this can only be 8 bit ASCII characters. in general, passing a
> string should mean worrying about encoding. realistically, the string
> will just be stripped to it's low order bytes.
> 
> - robert

Why 8 bit ASCII ? Shouldn't it be 7 bit ASCII? The first 7 bit of the
US-ASCII should be present in every encoding, right?

RFC2046:
   As stated in the definition of the Content-Transfer-Encoding field
   [RFC 2045], no encoding other than "7bit", "8bit", or "binary" is
   permitted for entities of type "multipart".  The "multipart" boundary
   delimiters and header fields are always represented as 7bit US-ASCII
   in any case (though the header fields may encode non-US-ASCII header
   text as per RFC 2047) and data within the body parts can be encoded
   on a part-by-part basis, with Content-Transfer-Encoding fields for
   each appropriate body part.

Stefano


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to