Re: Gnu mail bug

Chris Burdess <[email protected]>
Newsgroups gmane.comp.java.classpath.extensions.javamail
Message-ID <[email protected]>
Countach wrote:
> You seem to have changed my patch resulting in a bug.
>
> My patch said:
>
>  protected MboxFolder(MboxStore store, String name, boolean inbox)
>  {
>    super(store);
>    this.name = name;
>    if (0 < name.length() && name.charAt(0) == '/') {
>      file = new File(canonicalNameToLocal(name));
>    } else {
>      file = new File(store.getMailRootDir(), 
> canonicalNameToLocal(name));
>    }
>
>
> But the cvs code seems to say:
>
>  protected MboxFolder(MboxStore store, String name, boolean inbox)
>  {
>    super(store);
>    this.name = name;
>    file = new File(store.getMailRootDir(), canonicalNameToLocal(name));
>
> The trouble is, this only allows for relative names. My original patch 
> checked for the leading '/' so that you could use relative or absolute 
> paths.

The problem is that URLName.getFile returns paths that do not include 
the leading '/', unlike java.net.URL. Typically, in JavaMail 
applications, the mailbox is represented as a URLName rather than the 
user being able to specify the exact string to pass to getFolder(). We 
need a consistent way to treat file paths that doesn't depend on a 
leading '/' - if you have any suggestions they would be most welcome.
-- 
Chris Burdess
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.