Skip to content
Snippets Groups Projects
Commit cd7002ca authored by Bunyamin Aslan's avatar Bunyamin Aslan
Browse files

Up to date with release 0.4

parent c03d871b
No related branches found
No related tags found
No related merge requests found
Pipeline #1283 passed
......@@ -3,25 +3,25 @@
# Server settings
#Port where the server will be listening
SERVER_PORT=8025
MONGOMAIL_SERVER_PORT=8025
#Hostname of the server
SERVER_HOSTNAME=localhost
MONGOMAIL_SERVER_HOSTNAME=localhost
#How many thread are always running in the server (even if no client to handle)
#CONNECTION_CORE=0
#Max connection that can handle the server at the same time
CONNECTION_MAX=1024
MONGOMAIL_CONNECTION_MAX=1024
#Seconds that have the client to send the mail
IDLE_TIMEOUT=5
MONGOMAIL_IDLE_TIMEOUT=5
# DB settings
#MongoDb host IP
DB_HOST=127.0.0.1
MONGOMAIL_DB_HOST=127.0.0.1
#MongoDb Port (generally 27017 if localhost)
DB_PORT=27017
MONGOMAIL_DB_PORT=27017
#MongoDb database name to use
DB_NAME=mydb
MONGOMAIL_DB_NAME=mydb
#MongoDb collection name to use (to store mails)
COLLECTION_NAME=mail_collection
MONGOMAIL_COLLECTION_NAME=mail_collection
#MongoDb bucket name to use (to store files)
BUCKET_NAME=attachments
MONGOMAIL_BUCKET_NAME=attachments
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</goal>
</goals>
<properties>
<exec.args>-classpath %classpath be.cylab.mongomailexample.Main</exec.args>
<exec.executable>java</exec.executable>
</properties>
</action>
</actions>
......@@ -24,7 +24,7 @@
<dependency>
<groupId>be.cylab</groupId>
<artifactId>mongo-mail</artifactId>
<version>0.0.2</version>
<version>0.0.4</version>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
......
......@@ -32,9 +32,11 @@ public class Main {
* @throws AddressException exc.
* @throws MessagingException exc.
* @throws IOException exc.
* @throws java.lang.InterruptedException
*/
public static void main(final String[] args)
throws AddressException, MessagingException, IOException {
throws AddressException, MessagingException,
IOException, InterruptedException {
Server.launchServer("./", "./");
MailSender mail_sender = new MailSender();
//Simple mail from bob to alice
......@@ -56,9 +58,15 @@ public class Main {
mail_sender.addAttachment(new Attachment("attachments/doc.odt"));
mail_sender.sendMail();
//Waiting a little the library finishing its work
Thread.sleep(1000);
//Retrieve the second mail, also download the attachment from mongodb
MailRetriever retriever = new MailRetriever();
Document mail2 = retriever.retrieveMail();
retriever.downloadAttachment(mail2);
Server.stopServer();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment