You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by ma...@apache.org on 2014/03/20 09:16:10 UTC
svn commit: r1579559 [12/23] - in /james/hupa/trunk: ./ client/
client/src/main/java/com/google/web/bindery/requestfactory/server/
client/src/main/java/org/apache/hupa/
client/src/main/java/org/apache/hupa/client/
client/src/main/java/org/apache/hupa/c...
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/JavamailUtil.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/JavamailUtil.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/JavamailUtil.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/JavamailUtil.java Thu Mar 20 08:16:02 2014
@@ -31,10 +31,10 @@ import org.apache.hupa.shared.data.Messa
*
*/
public class JavamailUtil {
-
+
/**
* Convert the given Flags to a ArrayList of IMAPFlags
- *
+ *
* @param flags
* @return imapFlags
*/
@@ -44,15 +44,15 @@ public class JavamailUtil {
fList.add(convert(flag));
}
return fList;
-
+
}
-
+
public static IMAPFlag convert(Flag flag) {
if (flag.equals(Flag.SEEN)) {
return IMAPFlag.SEEN;
} else if (flag.equals(Flag.RECENT)) {
return IMAPFlag.RECENT;
- } else if (flag.equals(Flag.ANSWERED)) {
+ } else if (flag.equals(Flag.ANSWERED)) {
return IMAPFlag.ANSWERED;
} else if (flag.equals(Flag.DELETED)) {
return IMAPFlag.DELETED;
@@ -63,12 +63,12 @@ public class JavamailUtil {
} else if (flag.equals(Flag.USER)) {
return IMAPFlag.USER;
}
-
+
throw new IllegalArgumentException("Flag not supported " + flag);
}
/**
* Convert the given ArrayList of IMAPFlags to a Flags object
- *
+ *
* @param imapFlags
* @return flags
*/
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceListener.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceListener.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceListener.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceListener.java Thu Mar 20 08:16:02 2014
@@ -84,18 +84,18 @@ public class GuiceListener extends Guice
/**
* Loads the first available configuration file.
- *
- * The preference order for the file is:
+ *
+ * The preference order for the file is:
* 1.- file specified in a system property (-Dhupa.config.file=full_path_to_file).
* 2.- file in the user's home: $HOME/.hupa/config.properties.
* 3.- global configuration in the os: /etc/default/hupa.
* 4.- file provided in the .war distribution: "WEB-INF/conf/config.properties.
* 5.- mock properties file which makes the Hupa work in demo mode.
- *
+ *
* If the system property "mock-host" has been defined, and Hupa has been
* packaged with the mock stuff, we always return the demo-mode
* configuration.
- *
+ *
*/
public Properties loadProperties() {
Properties properties = null;
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceServerModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceServerModule.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceServerModule.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceServerModule.java Thu Mar 20 08:16:02 2014
@@ -135,7 +135,7 @@ public class GuiceServerModule extends A
@Override
protected void configure() {
-
+
try {
// Bind addresses and ports for imap and smtp
Names.bindProperties(binder(), properties);
@@ -148,9 +148,9 @@ public class GuiceServerModule extends A
bind(ExceptionHandler.class).to(DefaultExceptionHandler.class);
bind(ServiceLayerDecorator.class).to(IocRfServiceDecorator.class);
bind(IocRfServiceLocator.class);
-
+
bind(MailHeader.class).to(MailHeaderImpl.class);
-
+
bind(User.class).to(UserImpl.class);
bind(Settings.class).toProvider(DefaultUserSettingsProvider.class);
bind(ImapFolder.class).to(ImapFolderImpl.class);
@@ -158,7 +158,7 @@ public class GuiceServerModule extends A
bind(MessageDetails.class).to(MessageDetailsImpl.class);
bind(MessageAttachment.class).to(MessageAttachmentImpl.class);
bind(SmtpMessage.class).to(SmtpMessageImpl.class);
-
+
bind(GenericResult.class).to(GenericResultImpl.class);
bind(FetchMessagesAction.class).to(FetchMessagesActionImpl.class);
bind(FetchMessagesResult.class).to(FetchMessagesResultImpl.class);
@@ -177,14 +177,14 @@ public class GuiceServerModule extends A
bind(LogoutUserAction.class).to(LogoutUserActionImpl.class);
bind(MoveMessageAction.class).to(MoveMessageActionImpl.class);
bind(SetFlagAction.class).to(SetFlagActionImpl.class);
-
+
bind(FetchMessagesService.class).to(FetchMessagesServiceImpl.class);
bind(SendMessageService.class).to(SendMessageBaseServiceImpl.class);
bind(SendForwardMessageService.class).to(SendForwardMessageServiceImpl.class);
bind(SendReplyMessageService.class).to(SendReplyMessageServiceImpl.class);
bind(GetMessageDetailsService.class).to(GetMessageDetailsServiceImpl.class);
-
+
bind(CheckSessionService.class).to(CheckSessionServiceImpl.class);
bind(LoginUserService.class).to(LoginUserServiceImpl.class);
bind(ImapFolderService.class).to(ImapFolderServiceImpl.class);
@@ -198,7 +198,7 @@ public class GuiceServerModule extends A
bind(LogoutUserService.class).to(LogoutUserServiceImpl.class);
bind(MoveMessageService.class).to(MoveMessageServiceImpl.class);
bind(SetFlagService.class).to(SetFlagServiceImpl.class);
-
+
bind(IMAPStoreCache.class).to(getIMAPStoreCacheClass()).in(Singleton.class);
bind(Log.class).toProvider(LogProvider.class).in(Singleton.class);
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceWebModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceWebModule.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceWebModule.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/GuiceWebModule.java Thu Mar 20 08:16:02 2014
@@ -28,20 +28,20 @@ import com.google.inject.Singleton;
import com.google.inject.servlet.ServletModule;
public class GuiceWebModule extends ServletModule {
-
+
@Override
protected void configureServlets() {
System.err.println("GuiceWebModule configuring servlets.");
bind(IocRfServlet.class).in(Singleton.class);
serveRegex(".*/gwtRequest").with(IocRfServlet.class);
-
+
bind(DownloadAttachmentServlet.class).in(Singleton.class);
serveRegex(".*/" + SConsts.HUPA + SConsts.SERVLET_DOWNLOAD).with(DownloadAttachmentServlet.class);
-
+
bind(UploadAttachmentServlet.class).in(Singleton.class);
serveRegex(".*/" + SConsts.HUPA + SConsts.SERVLET_UPLOAD).with(UploadAttachmentServlet.class);
-
+
bind(MessageSourceServlet.class).in(Singleton.class);
serveRegex(".*/" + SConsts.HUPA + SConsts.SERVLET_SOURCE).with(MessageSourceServlet.class);
}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceDecorator.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceDecorator.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceDecorator.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceDecorator.java Thu Mar 20 08:16:02 2014
@@ -57,7 +57,7 @@ public final class IocRfServiceDecorator
public <T> T createDomainObject(Class<T> clazz) {
return injector.getInstance(clazz);
}
-
+
static int count = 0;
@Override
public Object invoke(Method domainMethod, Object... args) {
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceLocator.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceLocator.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceLocator.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/IocRfServiceLocator.java Thu Mar 20 08:16:02 2014
@@ -32,7 +32,7 @@ public class IocRfServiceLocator impleme
@Inject
private Injector injector;
-
+
@Override
public Object getInstance(Class<?> clazz) {
return injector.getInstance(clazz);
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/demo/DemoGuiceServerModule.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/demo/DemoGuiceServerModule.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/demo/DemoGuiceServerModule.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/ioc/demo/DemoGuiceServerModule.java Thu Mar 20 08:16:02 2014
@@ -46,27 +46,27 @@ public class DemoGuiceServerModule exten
super(properties);
new RuntimeException().printStackTrace();
}
-
+
protected Class<? extends IMAPStoreCache> getIMAPStoreCacheClass() {
return DemoIMAPStoreCache.class;
}
-
+
/**
* IMAPStoreCache implementation for Demo mode.
- *
+ *
* It uses mock module which emulates fake imap and smtp servers based on
* a set of example messages in filesystem and used for unit tests.
- *
- * We use here reflection so as we can deliver Hupa without mock stuff.
+ *
+ * We use here reflection so as we can deliver Hupa without mock stuff.
*
*/
public static class DemoIMAPStoreCache extends InMemoryIMAPStoreCache {
@Inject
- public DemoIMAPStoreCache(Log logger,
- @Named("IMAPConnectionPoolSize") int connectionPoolSize,
- @Named("IMAPConnectionPoolTimeout") int timeout,
- @Named("SessionDebug") boolean debug,
- @Named("TrustStore") String truststore,
+ public DemoIMAPStoreCache(Log logger,
+ @Named("IMAPConnectionPoolSize") int connectionPoolSize,
+ @Named("IMAPConnectionPoolTimeout") int timeout,
+ @Named("SessionDebug") boolean debug,
+ @Named("TrustStore") String truststore,
@Named("TrustStorePassword") String truststorePassword,
@Named("TrustSSL") boolean trustSSL) {
super(logger, connectionPoolSize, timeout, debug, truststore, truststorePassword, trustSSL);
@@ -86,7 +86,7 @@ public class DemoGuiceServerModule exten
}
return super.createCachedIMAPStore(user);
}
-
+
@Override
public void sendMessage(Message msg) throws MessagingException {
try {
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorage.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorage.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InImapUserPreferencesStorage.java Thu Mar 20 08:16:02 2014
@@ -59,30 +59,30 @@ import com.sun.mail.imap.IMAPStore;
/**
* A user preferences storage which uses IMAP as repository data
- *
+ *
* @author manolo
*/
public class InImapUserPreferencesStorage extends UserPreferencesStorage {
-
+
// User preferences are saved in IMAP but there is a delay between a new
// contact is added an the save action. It saves number of operations in
// the IMAP server.
// It's not final in order to override in tests to make them run faster
protected static int IMAP_SAVE_DELAY = 10000;
-
+
protected static final String MAGIC_SUBJECT_CONTACTS = "Hupa-Contacts";
-
+
private static final String HUPA_DATA_MIME_TYPE = "application/hupa-data";
-
+
private static Hashtable<User, Thread> threads = new Hashtable<User, Thread>();
-
+
/**
* Opens the IMAP folder and read messages until it founds the magic subject,
- * then gets the attachment which contains the data and return the serialized object stored.
+ * then gets the attachment which contains the data and return the serialized object stored.
*/
- protected static Object readUserPreferencesFromIMAP(Log logger, User user, IMAPStore iStore, String folderName, String magicType)
+ protected static Object readUserPreferencesFromIMAP(Log logger, User user, IMAPStore iStore, String folderName, String magicType)
throws MessagingException, IOException, ClassNotFoundException {
Folder folder = iStore.getFolder(folderName);
if (folder.exists()) {
@@ -116,12 +116,12 @@ public class InImapUserPreferencesStorag
}
return null;
}
-
+
/**
* Opens the IMAP folder, deletes all messages which match the magic subject and
* creates a new message with an attachment which contains the object serialized
*/
- protected static void saveUserPreferencesInIMAP(Log logger, User user, Session session, IMAPStore iStore, String folderName, String subject, Object object)
+ protected static void saveUserPreferencesInIMAP(Log logger, User user, Session session, IMAPStore iStore, String folderName, String subject, Object object)
throws MessagingException, IOException, InterruptedException {
IMAPFolder folder = (IMAPFolder) iStore.getFolder(folderName);
@@ -140,7 +140,7 @@ public class InImapUserPreferencesStorag
// Create a new message with an attachment which has the serialized object
MimeMessage message = new MimeMessage(session);
message.setSubject(subject);
-
+
Multipart multipart = new MimeMultipart();
MimeBodyPart txtPart = new MimeBodyPart();
txtPart.setContent("This message contains configuration used by Hupa, do not delete it", "text/plain");
@@ -158,7 +158,7 @@ public class InImapUserPreferencesStorag
msg.setFlag(Flag.DELETED, true);
}
}
-
+
// It is necessary to copy the message before saving it (the same problem in AbstractSendMessageHandler)
message = new MimeMessage((MimeMessage)message);
message.setFlag(Flag.SEEN, true);
@@ -169,7 +169,7 @@ public class InImapUserPreferencesStorag
logger.error("Unable to save preferences " + subject + " in imap folder " + folderName + " for user " + user);
}
}
-
+
/**
* Right now, using the same approach present in upload attachments to create the attachment
*/
@@ -179,13 +179,13 @@ public class InImapUserPreferencesStorag
UploadServlet.copyFromInputStreamToOutputStream(is, item.getOutputStream());
return item;
}
-
+
private Log logger;
-
+
private final IMAPStoreCache cache;
private final Provider<HttpSession> sessionProvider;
-
+
/**
* Constructor
*/
@@ -210,7 +210,7 @@ public class InImapUserPreferencesStorag
}
}
}
-
+
/* (non-Javadoc)
* @see org.apache.hupa.server.preferences.UserPreferencesStorage#getContacts()
*/
@@ -248,7 +248,7 @@ public class InImapUserPreferencesStorag
* 2.- It saves number of save operations, because the method addContact
* is called frequently when fetching a folder, so add these contacts are
* added to the session list, and a thread is delayed to store
- * all the block.
+ * all the block.
*/
private void saveContactsAsync(User user) {
Thread thread = threads.get(user);
@@ -260,21 +260,21 @@ public class InImapUserPreferencesStorag
}
/**
- * The thread class which saves asynchronously the user preferences
+ * The thread class which saves asynchronously the user preferences
*/
private class SavePreferencesThread extends Thread {
private String folderName = null;
private Object object = null;
private String subject = null;
private User user = null;
-
+
public SavePreferencesThread(User user, String subject, Object object) {
this.user = user;
this.folderName = user.getSettings().getDraftsFolderName();
this.subject = subject;
this.object = object;
}
-
+
public void run(){
try {
sleep(IMAP_SAVE_DELAY);
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InSessionUserPreferencesStorage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InSessionUserPreferencesStorage.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InSessionUserPreferencesStorage.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/InSessionUserPreferencesStorage.java Thu Mar 20 08:16:02 2014
@@ -37,7 +37,7 @@ import javax.servlet.http.HttpSession;
public class InSessionUserPreferencesStorage extends UserPreferencesStorage {
private final Provider<HttpSession> sessionProvider;
-
+
@Inject
public InSessionUserPreferencesStorage(IMAPStoreCache cache, Log logger, Provider<HttpSession> sessionProvider) {
this.sessionProvider = sessionProvider;
@@ -52,7 +52,7 @@ public class InSessionUserPreferencesSto
sessionContacts=new HashMap<String, Contact>();
session.setAttribute(SConsts.CONTACTS_SESS_ATTR, sessionContacts);
}
-
+
for(Contact contact: contacts) {
if (!sessionContacts.containsKey(contact.toKey())) {
sessionContacts.put(contact.toKey(), contact);
@@ -62,7 +62,7 @@ public class InSessionUserPreferencesSto
public Contact[] getContacts() {
HttpSession session = sessionProvider.get();
-
+
@SuppressWarnings("unchecked")
HashMap<String, Contact> sessionContacts = (HashMap<String, Contact>)session.getAttribute(SConsts.CONTACTS_SESS_ATTR);
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/UserPreferencesStorage.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/UserPreferencesStorage.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/UserPreferencesStorage.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/preferences/UserPreferencesStorage.java Thu Mar 20 08:16:02 2014
@@ -26,23 +26,23 @@ import java.util.List;
/**
*
- * Abstract class which defines storage operations related
+ * Abstract class which defines storage operations related
* with user preferences
*
*/
public abstract class UserPreferencesStorage {
-
+
protected static final String REGEX_OMITTED_EMAILS = "^.*(reply)[A-z0-9._%\\+\\-]*@.*$";
-
+
/**
* Add a new contact to the list.
- * The implementation has to check for duplicates
+ * The implementation has to check for duplicates
*/
abstract public void addContact(Contact... c);
-
+
/**
* Add a new contact to the list.
- * The implementation has to check for duplicates
+ * The implementation has to check for duplicates
*/
final public void addContact(String... mails) {
if (mails != null) {
@@ -52,7 +52,7 @@ public abstract class UserPreferencesSto
/**
* Add a new contact to the list.
- * The implementation has to check for duplicates
+ * The implementation has to check for duplicates
*/
final public void addContact(List<String> mails) {
if (mails != null) {
@@ -66,7 +66,7 @@ public abstract class UserPreferencesSto
}
}
}
-
+
boolean exists (Contact mail) {
for (Contact c : getContacts()) {
if (c.mail.equals(mail.mail)) {
@@ -78,9 +78,9 @@ public abstract class UserPreferencesSto
}
return false;
}
-
+
/**
- * Get the list of contacts
+ * Get the list of contacts
*/
abstract public Contact[] getContacts();
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/AbstractService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/AbstractService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/AbstractService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/AbstractService.java Thu Mar 20 08:16:02 2014
@@ -1,50 +1,50 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.servlet.http.HttpSession;
-
-import org.apache.commons.logging.Log;
-import org.apache.hupa.server.IMAPStoreCache;
-import org.apache.hupa.shared.SConsts;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-import org.apache.hupa.shared.exception.InvalidSessionException;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public abstract class AbstractService {
-
- @Inject protected IMAPStoreCache cache;
- @Inject protected Provider<HttpSession> httpSessionProvider;
- @Inject protected Log logger;
-
- protected User getUser() throws HupaException{
- User user = (User) httpSessionProvider.get().getAttribute(SConsts.USER_SESS_ATTR);
- if (user == null) {
- throw new InvalidSessionException(getClass().getSimpleName()
- + User.NOT_FOUND
- + httpSessionProvider.get().getId());
- } else {
- return user;
- }
- }
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.commons.logging.Log;
+import org.apache.hupa.server.IMAPStoreCache;
+import org.apache.hupa.shared.SConsts;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+import org.apache.hupa.shared.exception.InvalidSessionException;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public abstract class AbstractService {
+
+ @Inject protected IMAPStoreCache cache;
+ @Inject protected Provider<HttpSession> httpSessionProvider;
+ @Inject protected Log logger;
+
+ protected User getUser() throws HupaException{
+ User user = (User) httpSessionProvider.get().getAttribute(SConsts.USER_SESS_ATTR);
+ if (user == null) {
+ throw new InvalidSessionException(getClass().getSimpleName()
+ + User.NOT_FOUND
+ + httpSessionProvider.get().getId());
+ } else {
+ return user;
+ }
+ }
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionService.java Thu Mar 20 08:16:02 2014
@@ -1,28 +1,28 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-public interface CheckSessionService {
- public User getUser() throws HupaException;
- public Boolean isValid() throws HupaException;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+public interface CheckSessionService {
+ public User getUser() throws HupaException;
+ public Boolean isValid() throws HupaException;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CheckSessionServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,36 +1,36 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import org.apache.hupa.shared.SConsts;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-public class CheckSessionServiceImpl extends AbstractService implements CheckSessionService {
-
- @Override
- public User getUser() throws HupaException{
- return (User) httpSessionProvider.get().getAttribute(SConsts.USER_SESS_ATTR);
- }
-
- public Boolean isValid() throws HupaException{
- return getUser() != null && getUser().getAuthenticated();
- }
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import org.apache.hupa.shared.SConsts;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+public class CheckSessionServiceImpl extends AbstractService implements CheckSessionService {
+
+ @Override
+ public User getUser() throws HupaException{
+ return (User) httpSessionProvider.get().getAttribute(SConsts.USER_SESS_ATTR);
+ }
+
+ public Boolean isValid() throws HupaException{
+ return getUser() != null && getUser().getAuthenticated();
+ }
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderService.java Thu Mar 20 08:16:02 2014
@@ -1,27 +1,27 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import org.apache.hupa.shared.domain.CreateFolderAction;
-import org.apache.hupa.shared.domain.GenericResult;
-
-public interface CreateFolderService {
- GenericResult create(CreateFolderAction action) throws Exception;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import org.apache.hupa.shared.domain.CreateFolderAction;
+import org.apache.hupa.shared.domain.GenericResult;
+
+public interface CreateFolderService {
+ GenericResult create(CreateFolderAction action) throws Exception;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/CreateFolderServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,50 +1,50 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.mail.Folder;
-
-import org.apache.hupa.shared.data.GenericResultImpl;
-import org.apache.hupa.shared.domain.CreateFolderAction;
-import org.apache.hupa.shared.domain.GenericResult;
-import org.apache.hupa.shared.domain.ImapFolder;
-import org.apache.hupa.shared.domain.User;
-
-import com.sun.mail.imap.IMAPStore;
-
-public class CreateFolderServiceImpl extends AbstractService implements CreateFolderService {
-
- @Override
- public GenericResult create(CreateFolderAction action) throws Exception {
- User user = getUser();
- ImapFolder folder = action.getFolder();
- IMAPStore store = cache.get(user);
- Folder f = store.getFolder(folder.getFullName());
- if (f.create(Folder.HOLDS_MESSAGES)) {
- logger.info("Successfully create folder " + folder + " for user " + user);
- return new GenericResultImpl();
- } else {
- logger.info("Unable to create folder " + folder + " for user " + user);
- throw new Exception("Unable to create folder " + folder + " for user " + user);
-
- }
- }
-
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.mail.Folder;
+
+import org.apache.hupa.shared.data.GenericResultImpl;
+import org.apache.hupa.shared.domain.CreateFolderAction;
+import org.apache.hupa.shared.domain.GenericResult;
+import org.apache.hupa.shared.domain.ImapFolder;
+import org.apache.hupa.shared.domain.User;
+
+import com.sun.mail.imap.IMAPStore;
+
+public class CreateFolderServiceImpl extends AbstractService implements CreateFolderService {
+
+ @Override
+ public GenericResult create(CreateFolderAction action) throws Exception {
+ User user = getUser();
+ ImapFolder folder = action.getFolder();
+ IMAPStore store = cache.get(user);
+ Folder f = store.getFolder(folder.getFullName());
+ if (f.create(Folder.HOLDS_MESSAGES)) {
+ logger.info("Successfully create folder " + folder + " for user " + user);
+ return new GenericResultImpl();
+ } else {
+ logger.info("Unable to create folder " + folder + " for user " + user);
+ throw new Exception("Unable to create folder " + folder + " for user " + user);
+
+ }
+ }
+
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderService.java Thu Mar 20 08:16:02 2014
@@ -1,30 +1,30 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.domain.DeleteFolderAction;
-import org.apache.hupa.shared.domain.GenericResult;
-import org.apache.hupa.shared.exception.HupaException;
-
-public interface DeleteFolderService {
- GenericResult delete(DeleteFolderAction action) throws HupaException, MessagingException;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.domain.DeleteFolderAction;
+import org.apache.hupa.shared.domain.GenericResult;
+import org.apache.hupa.shared.exception.HupaException;
+
+public interface DeleteFolderService {
+ GenericResult delete(DeleteFolderAction action) throws HupaException, MessagingException;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteFolderServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,58 +1,58 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.mail.Folder;
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.data.GenericResultImpl;
-import org.apache.hupa.shared.domain.DeleteFolderAction;
-import org.apache.hupa.shared.domain.GenericResult;
-import org.apache.hupa.shared.domain.ImapFolder;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-import com.sun.mail.imap.IMAPStore;
-
-public class DeleteFolderServiceImpl extends AbstractService implements DeleteFolderService {
-
- @Override
- public GenericResult delete(DeleteFolderAction action) throws HupaException, MessagingException {
- User user = getUser();
- ImapFolder folder = action.getFolder();
- IMAPStore store = cache.get(user);
-
- Folder f = store.getFolder(folder.getFullName());
-
- // close the folder if its open
- if (f.isOpen()) {
- f.close(false);
- }
-
- // recursive delete the folder
- if (f.delete(true)) {
- logger.info("Successfully delete folder " + folder + " for user " + user);
- return new GenericResultImpl();
- } else {
- throw new HupaException("Unable to delete folder " + folder + " for user " + user);
- }
- }
-
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.mail.Folder;
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.data.GenericResultImpl;
+import org.apache.hupa.shared.domain.DeleteFolderAction;
+import org.apache.hupa.shared.domain.GenericResult;
+import org.apache.hupa.shared.domain.ImapFolder;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+import com.sun.mail.imap.IMAPStore;
+
+public class DeleteFolderServiceImpl extends AbstractService implements DeleteFolderService {
+
+ @Override
+ public GenericResult delete(DeleteFolderAction action) throws HupaException, MessagingException {
+ User user = getUser();
+ ImapFolder folder = action.getFolder();
+ IMAPStore store = cache.get(user);
+
+ Folder f = store.getFolder(folder.getFullName());
+
+ // close the folder if its open
+ if (f.isOpen()) {
+ f.close(false);
+ }
+
+ // recursive delete the folder
+ if (f.delete(true)) {
+ logger.info("Successfully delete folder " + folder + " for user " + user);
+ return new GenericResultImpl();
+ } else {
+ throw new HupaException("Unable to delete folder " + folder + " for user " + user);
+ }
+ }
+
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllService.java Thu Mar 20 08:16:02 2014
@@ -1,27 +1,27 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import org.apache.hupa.shared.domain.DeleteMessageAction;
-import org.apache.hupa.shared.domain.DeleteMessageResult;
-
-public interface DeleteMessageAllService {
- public DeleteMessageResult delete(DeleteMessageAction action) throws Exception;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import org.apache.hupa.shared.domain.DeleteMessageAction;
+import org.apache.hupa.shared.domain.DeleteMessageResult;
+
+public interface DeleteMessageAllService {
+ public DeleteMessageResult delete(DeleteMessageAction action) throws Exception;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageAllServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,57 +1,57 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.mail.Folder;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.domain.DeleteMessageAction;
-import org.apache.hupa.shared.domain.DeleteMessageAllAction;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-import com.sun.mail.imap.IMAPFolder;
-import com.sun.mail.imap.IMAPStore;
-
-public class DeleteMessageAllServiceImpl extends DeleteMessageBaseServiceImpl implements DeleteMessageAllService {
-
- @Override
- protected Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException {
- DeleteMessageAllAction action = (DeleteMessageAllAction) actionBase;
- User user = getUser();
- try {
- logger.info("Delete all messages in folder " + action.getFolder() + " for user " + user);
- IMAPStore store = cache.get(user);
- IMAPFolder folder = (IMAPFolder) store.getFolder(action.getFolder().getFullName());
- if (folder.isOpen() == false) {
- folder.open(Folder.READ_WRITE);
- }
- return folder.getMessages();
- } catch (MessagingException e) {
- String errorMsg = "Error while deleting all messages in folder " + action.getFolder() + " for user " + user;
- logger.error(errorMsg, e);
- throw new HupaException(errorMsg);
-
- }
-
- }
-
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.mail.Folder;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.domain.DeleteMessageAction;
+import org.apache.hupa.shared.domain.DeleteMessageAllAction;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+import com.sun.mail.imap.IMAPFolder;
+import com.sun.mail.imap.IMAPStore;
+
+public class DeleteMessageAllServiceImpl extends DeleteMessageBaseServiceImpl implements DeleteMessageAllService {
+
+ @Override
+ protected Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException {
+ DeleteMessageAllAction action = (DeleteMessageAllAction) actionBase;
+ User user = getUser();
+ try {
+ logger.info("Delete all messages in folder " + action.getFolder() + " for user " + user);
+ IMAPStore store = cache.get(user);
+ IMAPFolder folder = (IMAPFolder) store.getFolder(action.getFolder().getFullName());
+ if (folder.isOpen() == false) {
+ folder.open(Folder.READ_WRITE);
+ }
+ return folder.getMessages();
+ } catch (MessagingException e) {
+ String errorMsg = "Error while deleting all messages in folder " + action.getFolder() + " for user " + user;
+ logger.error(errorMsg, e);
+ throw new HupaException(errorMsg);
+
+ }
+
+ }
+
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageBaseServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageBaseServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageBaseServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageBaseServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,100 +1,100 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import javax.mail.Flags;
-import javax.mail.Message;
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.data.DeleteMessageResultImpl;
-import org.apache.hupa.shared.domain.DeleteMessageAction;
-import org.apache.hupa.shared.domain.DeleteMessageResult;
-import org.apache.hupa.shared.domain.ImapFolder;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-import com.sun.mail.imap.IMAPStore;
-
-public abstract class DeleteMessageBaseServiceImpl extends AbstractService{
- public DeleteMessageResult delete(DeleteMessageAction action) throws HupaException {
- ImapFolder folder = action.getFolder();
- User user = getUser();
- try {
- IMAPStore store = cache.get(user);
- com.sun.mail.imap.IMAPFolder f = (com.sun.mail.imap.IMAPFolder) store
- .getFolder(folder.getFullName());
- // check if the folder is open, if not open it "rw"
- if (f.isOpen() == false) {
- f.open(com.sun.mail.imap.IMAPFolder.READ_WRITE);
- }
-
- Message[] mArray = getMessagesToDelete(action);
-
- // check if the delete was triggered not in the trash folder
- if (folder.getFullName().equalsIgnoreCase(
- user.getSettings().getTrashFolderName()) == false) {
- com.sun.mail.imap.IMAPFolder trashFolder = (com.sun.mail.imap.IMAPFolder) store
- .getFolder(user.getSettings().getTrashFolderName());
-
- boolean trashFound = false;
- // if the trash folder does not exist we create it
- if (trashFolder.exists() == false) {
- trashFound = trashFolder
- .create(com.sun.mail.imap.IMAPFolder.READ_WRITE);
- } else {
- trashFound = true;
- }
-
- // Check if we are able to copy the messages to the trash folder
- if (trashFound) {
- // copy the messages to the trashfolder
- f.copyMessages(mArray, trashFolder);
- }
- }
-
-
- // delete the messages from the folder
- f.setFlags(mArray, new Flags(Flags.Flag.DELETED), true);
-
- try {
- f.expunge(mArray);
- f.close(false);
- } catch (MessagingException e) {
- // prolly UID expunge is not supported
- f.close(true);
- }
- return new DeleteMessageResultImpl(user, folder, mArray.length);
-
- } catch (MessagingException e) {
- logger.error("Error while deleting messages for user " + user
- + " in folder" + action.getFolder(), e);
- throw new HupaException("Error while deleting messages");
- }
- }
-
-
- /**
- * Return an array holding all messages which should get deleted by the given action
- *
- * @param action
- * @return messages
- */
- protected abstract Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import javax.mail.Flags;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.data.DeleteMessageResultImpl;
+import org.apache.hupa.shared.domain.DeleteMessageAction;
+import org.apache.hupa.shared.domain.DeleteMessageResult;
+import org.apache.hupa.shared.domain.ImapFolder;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+import com.sun.mail.imap.IMAPStore;
+
+public abstract class DeleteMessageBaseServiceImpl extends AbstractService{
+ public DeleteMessageResult delete(DeleteMessageAction action) throws HupaException {
+ ImapFolder folder = action.getFolder();
+ User user = getUser();
+ try {
+ IMAPStore store = cache.get(user);
+ com.sun.mail.imap.IMAPFolder f = (com.sun.mail.imap.IMAPFolder) store
+ .getFolder(folder.getFullName());
+ // check if the folder is open, if not open it "rw"
+ if (f.isOpen() == false) {
+ f.open(com.sun.mail.imap.IMAPFolder.READ_WRITE);
+ }
+
+ Message[] mArray = getMessagesToDelete(action);
+
+ // check if the delete was triggered not in the trash folder
+ if (folder.getFullName().equalsIgnoreCase(
+ user.getSettings().getTrashFolderName()) == false) {
+ com.sun.mail.imap.IMAPFolder trashFolder = (com.sun.mail.imap.IMAPFolder) store
+ .getFolder(user.getSettings().getTrashFolderName());
+
+ boolean trashFound = false;
+ // if the trash folder does not exist we create it
+ if (trashFolder.exists() == false) {
+ trashFound = trashFolder
+ .create(com.sun.mail.imap.IMAPFolder.READ_WRITE);
+ } else {
+ trashFound = true;
+ }
+
+ // Check if we are able to copy the messages to the trash folder
+ if (trashFound) {
+ // copy the messages to the trashfolder
+ f.copyMessages(mArray, trashFolder);
+ }
+ }
+
+
+ // delete the messages from the folder
+ f.setFlags(mArray, new Flags(Flags.Flag.DELETED), true);
+
+ try {
+ f.expunge(mArray);
+ f.close(false);
+ } catch (MessagingException e) {
+ // prolly UID expunge is not supported
+ f.close(true);
+ }
+ return new DeleteMessageResultImpl(user, folder, mArray.length);
+
+ } catch (MessagingException e) {
+ logger.error("Error while deleting messages for user " + user
+ + " in folder" + action.getFolder(), e);
+ throw new HupaException("Error while deleting messages");
+ }
+ }
+
+
+ /**
+ * Return an array holding all messages which should get deleted by the given action
+ *
+ * @param action
+ * @return messages
+ */
+ protected abstract Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidService.java Thu Mar 20 08:16:02 2014
@@ -1,28 +1,28 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import org.apache.hupa.shared.domain.DeleteMessageAction;
-import org.apache.hupa.shared.domain.DeleteMessageResult;
-import org.apache.hupa.shared.exception.HupaException;
-
-public interface DeleteMessageByUidService {
- public DeleteMessageResult delete(DeleteMessageAction action) throws HupaException;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import org.apache.hupa.shared.domain.DeleteMessageAction;
+import org.apache.hupa.shared.domain.DeleteMessageResult;
+import org.apache.hupa.shared.exception.HupaException;
+
+public interface DeleteMessageByUidService {
+ public DeleteMessageResult delete(DeleteMessageAction action) throws HupaException;
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidServiceImpl.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidServiceImpl.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidServiceImpl.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/DeleteMessageByUidServiceImpl.java Thu Mar 20 08:16:02 2014
@@ -1,71 +1,71 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.mail.Message;
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.domain.DeleteMessageAction;
-import org.apache.hupa.shared.domain.DeleteMessageByUidAction;
-import org.apache.hupa.shared.domain.ImapFolder;
-import org.apache.hupa.shared.domain.User;
-import org.apache.hupa.shared.exception.HupaException;
-
-import com.sun.mail.imap.IMAPStore;
-
-public class DeleteMessageByUidServiceImpl extends DeleteMessageBaseServiceImpl implements DeleteMessageByUidService{
-
- @Override
- protected Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException {
- DeleteMessageByUidAction action = (DeleteMessageByUidAction)actionBase;
- ImapFolder folder = action.getFolder();
- List<Long> uids = action.getMessageUids();
- User user = getUser();
-
- logger.info("Deleting messages with uids " + action.getMessageUids()
- + " for user " + user + " in folder " + action.getFolder());
- try {
- IMAPStore store = cache.get(user);
- com.sun.mail.imap.IMAPFolder f = (com.sun.mail.imap.IMAPFolder) store
- .getFolder(folder.getFullName());
- // check if the folder is open, if not open it "rw"
- if (f.isOpen() == false) {
- f.open(com.sun.mail.imap.IMAPFolder.READ_WRITE);
- }
- // build up the list of messages to delete
- List<Message> messages = new ArrayList<Message>();
- for (Long uid : uids) {
- messages.add(f.getMessageByUID(uid));
- }
- Message[] mArray = messages.toArray(new Message[messages.size()]);
- return mArray;
- } catch (MessagingException e) {
- logger.error("Error while deleting messages with uids "
- + action.getMessageUids() + " for user " + user
- + " in folder" + action.getFolder(), e);
- throw new HupaException("Error while deleting messages", e);
- }
-
- }
-
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.domain.DeleteMessageAction;
+import org.apache.hupa.shared.domain.DeleteMessageByUidAction;
+import org.apache.hupa.shared.domain.ImapFolder;
+import org.apache.hupa.shared.domain.User;
+import org.apache.hupa.shared.exception.HupaException;
+
+import com.sun.mail.imap.IMAPStore;
+
+public class DeleteMessageByUidServiceImpl extends DeleteMessageBaseServiceImpl implements DeleteMessageByUidService{
+
+ @Override
+ protected Message[] getMessagesToDelete(DeleteMessageAction actionBase) throws HupaException {
+ DeleteMessageByUidAction action = (DeleteMessageByUidAction)actionBase;
+ ImapFolder folder = action.getFolder();
+ List<Long> uids = action.getMessageUids();
+ User user = getUser();
+
+ logger.info("Deleting messages with uids " + action.getMessageUids()
+ + " for user " + user + " in folder " + action.getFolder());
+ try {
+ IMAPStore store = cache.get(user);
+ com.sun.mail.imap.IMAPFolder f = (com.sun.mail.imap.IMAPFolder) store
+ .getFolder(folder.getFullName());
+ // check if the folder is open, if not open it "rw"
+ if (f.isOpen() == false) {
+ f.open(com.sun.mail.imap.IMAPFolder.READ_WRITE);
+ }
+ // build up the list of messages to delete
+ List<Message> messages = new ArrayList<Message>();
+ for (Long uid : uids) {
+ messages.add(f.getMessageByUID(uid));
+ }
+ Message[] mArray = messages.toArray(new Message[messages.size()]);
+ return mArray;
+ } catch (MessagingException e) {
+ logger.error("Error while deleting messages with uids "
+ + action.getMessageUids() + " for user " + user
+ + " in folder" + action.getFolder(), e);
+ throw new HupaException("Error while deleting messages", e);
+ }
+
+ }
+
+}
Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/FetchFoldersService.java
URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/FetchFoldersService.java?rev=1579559&r1=1579558&r2=1579559&view=diff
==============================================================================
--- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/FetchFoldersService.java (original)
+++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/service/FetchFoldersService.java Thu Mar 20 08:16:02 2014
@@ -1,31 +1,31 @@
-/****************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one *
- * or more contributor license agreements. See the NOTICE file *
- * distributed with this work for additional information *
- * regarding copyright ownership. The ASF licenses this file *
- * to you under the Apache License, Version 2.0 (the *
- * "License"); you may not use this file except in compliance *
- * with the License. You may obtain a copy of the License at *
- * *
- * http://www.apache.org/licenses/LICENSE-2.0 *
- * *
- * Unless required by applicable law or agreed to in writing, *
- * software distributed under the License is distributed on an *
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
- * KIND, either express or implied. See the License for the *
- * specific language governing permissions and limitations *
- * under the License. *
- ****************************************************************/
-
-package org.apache.hupa.server.service;
-
-import java.util.List;
-
-import javax.mail.MessagingException;
-
-import org.apache.hupa.shared.domain.ImapFolder;
-import org.apache.hupa.shared.exception.HupaException;
-
-public interface FetchFoldersService {
- List<ImapFolder> fetch(ImapFolder folder, Boolean recursive) throws MessagingException, HupaException;
-}
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.hupa.server.service;
+
+import java.util.List;
+
+import javax.mail.MessagingException;
+
+import org.apache.hupa.shared.domain.ImapFolder;
+import org.apache.hupa.shared.exception.HupaException;
+
+public interface FetchFoldersService {
+ List<ImapFolder> fetch(ImapFolder folder, Boolean recursive) throws MessagingException, HupaException;
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org