james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: [mime4J] MessageSearcher...? [WAS Re: [Mime4J] getReader]
Date Sun, 09 Mar 2008 22:01:30 GMT
Robert Burrell Donkin wrote:

> > > IMAP requires case-insensitive charset-aware searching of mail body
> > > parts (a bit of a PITA, i know and most likely slow). ATM the Mime4J
> > > pull parser has a getInputStream method but i plan to add a getReader
> > > method which will perform charset-aware content-decoding for text
> > > parts and return null for others (seems easier than throwing an
> > > exception but i'm willing to be talked out of this decision) since i
> > > think that this function may be generally useful.

I think that I'd rather we follow the example of other
getInputStream/getReader exemplars, and throw
java.io.UnsupportedEncodingException if it is called on a type for which a
Reader is not appropriate.

> does the message searcher (which searches a mail for a particular
> sequence of characters)  sounds like something which might be
> generally useful addition to Mime4J?

Yes.  But what do you propose as the interface?  If I asked you to search
for SOMETEXT, what do I get back?  I might want a collection of [part,
first_offset]-tuples.  Less than that, and you would be discarding
information that you should already have, more than that and I would be
forcing you to do extra work that a given use case might not require.  On
the other hand, perhaps I just want to know about the first part in which
you find it, not all parts containing it.  And can I ask that you search
only headers or parts of only certain content-type(s)?

Point being that, yes, I'd like to have a search functionality, but I'd like
some discussion over the interface and supported use cases.  And if we don't
build this into an existing class, it could be a shared utility, rather than
leaving it as just an example for people to clone.

	--- Noel

To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org

View raw message