Re: BUG in classpathx javamail MBOX
Countach <[email protected]>
| Newsgroups | gmane.comp.java.classpath.extensions.javamail |
|---|---|
| Message-ID | <[email protected]> |
Hi Chris,
I'm not quite sure what you patched or what you were trying to do, but
it still fails the test case:
store.getFolder(store.getDefaultFolder.getFullName())
because of the 4 lines of code previously discussed. I still believe
these lines need to be removed. I cannot see their purpose.
Chris Burdess wrote:
> 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...