[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Classpathx-javamail] clueless newbie -- how to open mbox?
From: |
Matej Cepl |
Subject: |
[Classpathx-javamail] clueless newbie -- how to open mbox? |
Date: |
Wed, 02 May 2007 14:48:03 +0200 |
User-agent: |
slrn/0.9.8.1pl2 (Linux) |
Hi, can somebody help me with this:
address@hidden mdir2mbox]$ cat -b Mdir2mbox.java
1 import java.util.*;
2 import javax.mail.*;
3 public class Mdir2mbox {
4 public static void main(String[] args) throws \
MessagingException {
5 String urlStr = "/home/matej/.eclipse\
/workspace/Mdir2mbox/examples/test";
6 Properties properties = new Properties();
7 Session session = Session.getInstance(properties);
8 URLName mboxURL = new URLName("mbox://"+urlStr);
9 Store store = session.getStore(mboxURL);
10 Folder folder = store.getDefaultFolder();
11 if(!folder.exists())
12 folder.create(Folder.HOLDS_MESSAGES);
13 folder.open(Folder.READ_WRITE);
14 System.out.println(folder.getMessageCount());
15 }
16 }
address@hidden mdir2mbox]$ ls -lh examples/test
-rw-r--r-- 1 matej matej 22K kvě 1 01:02 examples/test
address@hidden mdir2mbox]$ java Mdir2mbox
Exception in thread "main" java.lang.NullPointerException
at Mdir2mbox.main(Mdir2mbox.java:12)
address@hidden mdir2mbox]$ rpm -q classpathx-mail
classpathx-mail-1.1.1-4jpp.2
address@hidden mdir2mbox]$ java -version
java version "1.4.2"
gij (GNU libgcj) version 4.1.1 20070105 (Red Hat 4.1.1-51)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
address@hidden mdir2mbox]$
Whatever I do I don't see what I am doing wrong in this case. There is not
much examples on how to use java.mail with folders, but when I look at this
(among others)
http://article.gmane.org/gmane.comp.java.classpath.extensions.javamail/116 it
seems to me, that I am not doing anything extremely silly (it's Fedora Core 6).
Is there any hope for me, please?
Thanks a lot,
Matěj Cepl
- [Classpathx-javamail] clueless newbie -- how to open mbox?,
Matej Cepl <=
- Re: [Classpathx-javamail] clueless newbie -- how to open mbox?, Chris Burdess, 2007/05/02
- [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Matej Cepl, 2007/05/02
- [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Matej Cepl, 2007/05/02
- Re: [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Chris Burdess, 2007/05/03
- Re: [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Chris Burdess, 2007/05/03
- [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Matej Cepl, 2007/05/03
- Re: [Classpathx-javamail] Re: clueless newbie -- how to open mbox?, Chris Burdess, 2007/05/03