[tuxdroid-svn] r5591 - software_suite_v3/software/plugin/plugin-gmail/trunk/plugin-gmail/src/net/ka
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-10-05 11:36:44
|
Author: remi
Date: 2009-10-05 13:36:31 +0200 (Mon, 05 Oct 2009)
New Revision: 5591
Modified:
software_suite_v3/software/plugin/plugin-gmail/trunk/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
Log:
* Added an exception catch in start method
Modified: software_suite_v3/software/plugin/plugin-gmail/trunk/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java
===================================================================
--- software_suite_v3/software/plugin/plugin-gmail/trunk/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-05 11:27:41 UTC (rev 5590)
+++ software_suite_v3/software/plugin/plugin-gmail/trunk/plugin-gmail/src/net/karmaLab/tuxDroid/plugins/MailPlugin.java 2009-10-05 11:36:31 UTC (rev 5591)
@@ -50,9 +50,9 @@
{
new MailPlugin().boot(args, new Configuration());
}
-
+
/**
- *
+ *
*/
@Override
public void start()
@@ -60,21 +60,28 @@
this.configuration().setHost("pop.gmail.com");
this.configuration().setProtocol(ServerProtocol.pop3s);
- if (getCommand().equals("run"))
+ try
{
- run();
+ if (getCommand().equals("run"))
+ {
+ run();
+ }
+ else if (getCommand().equals("check"))
+ {
+ check();
+ }
+ else
+ {
+ run();
+ }
}
- else if (getCommand().equals("check"))
+ catch (Exception e)
{
- check();
+ throwMessage("Sorry, there was an error when connecting to the mail server. Please check your email configuration.");
}
- else
- {
- run();
- }
}
-
-
+
+
/**
* @throws MessagingException
* @throws IOException
@@ -82,7 +89,7 @@
*/
public void check() throws MessagingException, IOException, ClassNotFoundException, Exception
{
-
+
Message messages[] = connectToMailBox();
if (messages == null)
{
@@ -147,9 +154,9 @@
/* Save the current referenced mails */
writeState(stateAlert, sessionId + "ALERT");
}
-
+
/**
- *
+ *
* @throws MessagingException
* @throws IOException
* @throws ClassNotFoundException
@@ -181,7 +188,7 @@
if (newMessageRun)
{
int mailCounter = 0;
-
+
/* For all unread mails */
for (int i = 0; i < messages.length; i++)
{
@@ -264,9 +271,9 @@
/* Save the current referenced mails */
writeState(stateRun, sessionId + "RUN");
}
-
+
/**
- *
+ *
* @return
* @throws MessagingException
* @throws IOException
@@ -360,7 +367,7 @@
}
return false;
}
-
+
/**
* Return true if subject is not allowed.
* @param subject
@@ -387,14 +394,14 @@
}
@Override
- protected void onPluginEvent(String arg0, String[] arg1) throws Throwable
+ protected void onPluginEvent(String arg0, String[] arg1) throws Throwable
{
// TODO Auto-generated method stub
;
}
@Override
- protected void onPluginStop() throws Throwable
+ protected void onPluginStop() throws Throwable
{
// TODO Auto-generated method stub
;
|