classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-javamail] BUG in classpathx javamail MBOX


From: Chris Burdess
Subject: Re: [Classpathx-javamail] BUG in classpathx javamail MBOX
Date: Wed, 20 Apr 2005 18:47:11 +0100

Countach wrote:
There seems to be a bug in classpathx MBOX handling.

If you pass into the store the URL of the actual MBOX file, then call
getDefaultFolder(), it is named "" empty string, which is correct.
However when you pass this into the store as store.getFolder("") it
passes it to MboxFolder() and then it calls store.getMailRootDir(). In
this function it has the commentary:

  // If the url used to contruct the store references a file directly,
   // return this file.

However this is not true, because it has the code:

            if (!f.isDirectory())
                 {
                   f = f.getParentFile();
                 }


This is intended to mean "directory" in the commentary, which I have changed.

This means the commentary is wrong, and getFolder("") will not return
the default folder, but rather it tries to open the directory and gives
an error.

It seems to me the above lines should be removed. If somebody wants to
treat a directory as a collection of folders, they will pass the
directory in as the URL, and the above code will be unnecessary. And the
code as it is, is no good because
store.getFolder(store.getDefaultFolder.getFullName()) causes an error
when dealing with the actual MBOX file.

OK - I have supplied a fix which attempts to do what it says it does...
--
Chris Burdess





reply via email to

[Prev in Thread] Current Thread [Next in Thread]