Search in sources :

Example 1 with MailConfig

use of org.opensextant.xtext.collectors.mailbox.MailConfig in project Xponents by OpenSextant.

the class MailClientTest method main.

/**
     * Simple connection demo.  No mail reading... just configure, connect, disconnect.
     * @param args
     */
public static void main(String[] args) {
    try {
        System.out.println("Usage:  MailClientTest   cfg-url  /save/to/archive");
        MailConfig imapClientCfg;
        URL abc = MailClient.class.getResource(args[0]);
        imapClientCfg = new MailConfig(abc);
        MailClient imapClient = new MailClient(imapClientCfg, args[1]);
        imapClient.connect();
        imapClient.disconnect();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (ConfigException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (MessagingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : MessagingException(javax.mail.MessagingException) ConfigException(org.opensextant.ConfigException) MailClient(org.opensextant.xtext.collectors.mailbox.MailClient) IOException(java.io.IOException) MailConfig(org.opensextant.xtext.collectors.mailbox.MailConfig) URL(java.net.URL)

Aggregations

IOException (java.io.IOException)1 URL (java.net.URL)1 MessagingException (javax.mail.MessagingException)1 ConfigException (org.opensextant.ConfigException)1 MailClient (org.opensextant.xtext.collectors.mailbox.MailClient)1 MailConfig (org.opensextant.xtext.collectors.mailbox.MailConfig)1