[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Classpathx-javamail] Re: clueless newbie -- how to open mbox?
From: |
Matej Cepl |
Subject: |
[Classpathx-javamail] Re: clueless newbie -- how to open mbox? |
Date: |
Wed, 02 May 2007 20:51:43 +0200 |
User-agent: |
slrn/0.9.8.1pl2 (Linux) |
On 2007-05-02, 18:39 GMT, Matej Cepl wrote:
> OK, I got your point (and you are probably right, I just hoped
> it actually works this way a minute I begun to think about set
> of folders), but still no luck. However, I have a different
> exception now ;-):
When (following http://tinyurl.com/ysqmfx ) I tried other
variant, I got back to the square one:
address@hidden kmail2tbfolders]$ cat -b test.java
1 import java.util.*;
2 import javax.mail.*;
3 public class test {
4 public static void main(String[] args) throws
MessagingException {
5 String urlStr
= ``/home/matej/.eclipse/workspace\
/kmail2tbfolders/examples/``';
6 Session session = Session.getInstance(new
Properties());
7 URLName storeURL = new
URLName(``'mbox://``'+urlStr);
8 Store store
= session.getStore(storeURL);
9 Folder test
= store.getDefaultFolder();
10 test = test.getFolder(``'test``');
11 test.open(Folder.READ_WRITE);
12 try { 13
test.open(Folder.READ_WRITE);
14 } catch (MessagingException ex) {
15 test.open(Folder.READ_ONLY);
16 }
17 }
18 }
address@hidden kmail2tbfolders]$ gcj -C test.java
address@hidden kmail2tbfolders]$ gij test
Exception in thread ``'main``'
java.lang.NullPointerException
at test.main(test.java:11)
address@hidden kmail2tbfolders]$