-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Result of running `git add --renormalize .`
- Loading branch information
Showing
86 changed files
with
7,013 additions
and
7,013 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
68 changes: 34 additions & 34 deletions
68
greenmail-core/src/main/java/com/icegreen/greenmail/Managers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
/* | ||
* Copyright (c) 2014 Wael Chatila / Icegreen Technologies. All Rights Reserved. | ||
* This software is released under the Apache license 2.0 | ||
*/ | ||
package com.icegreen.greenmail; | ||
|
||
import com.icegreen.greenmail.imap.ImapHostManager; | ||
import com.icegreen.greenmail.imap.ImapHostManagerImpl; | ||
import com.icegreen.greenmail.smtp.SmtpManager; | ||
import com.icegreen.greenmail.store.InMemoryStore; | ||
import com.icegreen.greenmail.user.UserManager; | ||
|
||
/** | ||
* @author Wael Chatila | ||
* @version $Id: $ | ||
* @since Jan 27, 2006 | ||
*/ | ||
public class Managers { | ||
private ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore()); | ||
private UserManager userManager = new UserManager(imapHostManager); | ||
private SmtpManager smtpManager = new SmtpManager(imapHostManager, userManager); | ||
|
||
public SmtpManager getSmtpManager() { | ||
return smtpManager; | ||
} | ||
|
||
public UserManager getUserManager() { | ||
return userManager; | ||
} | ||
|
||
public ImapHostManager getImapHostManager() { | ||
return imapHostManager; | ||
} | ||
} | ||
/* | ||
* Copyright (c) 2014 Wael Chatila / Icegreen Technologies. All Rights Reserved. | ||
* This software is released under the Apache license 2.0 | ||
*/ | ||
package com.icegreen.greenmail; | ||
|
||
import com.icegreen.greenmail.imap.ImapHostManager; | ||
import com.icegreen.greenmail.imap.ImapHostManagerImpl; | ||
import com.icegreen.greenmail.smtp.SmtpManager; | ||
import com.icegreen.greenmail.store.InMemoryStore; | ||
import com.icegreen.greenmail.user.UserManager; | ||
|
||
/** | ||
* @author Wael Chatila | ||
* @version $Id: $ | ||
* @since Jan 27, 2006 | ||
*/ | ||
public class Managers { | ||
private ImapHostManager imapHostManager = new ImapHostManagerImpl(new InMemoryStore()); | ||
private UserManager userManager = new UserManager(imapHostManager); | ||
private SmtpManager smtpManager = new SmtpManager(imapHostManager, userManager); | ||
|
||
public SmtpManager getSmtpManager() { | ||
return smtpManager; | ||
} | ||
|
||
public UserManager getUserManager() { | ||
return userManager; | ||
} | ||
|
||
public ImapHostManager getImapHostManager() { | ||
return imapHostManager; | ||
} | ||
} |
102 changes: 51 additions & 51 deletions
102
greenmail-core/src/main/java/com/icegreen/greenmail/foedus/util/MsgRangeFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
/* | ||
* Copyright (c) 2014 Wael Chatila / Icegreen Technologies. All Rights Reserved. | ||
* This software is released under the Apache license 2.0 | ||
* This file has been used and modified. | ||
* Original file can be found on http://foedus.sourceforge.net | ||
*/ | ||
package com.icegreen.greenmail.foedus.util; | ||
|
||
|
||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
|
||
public class MsgRangeFilter { | ||
static final Pattern TWO_PART = Pattern.compile("(\\d+|\\*):(\\d+|\\*)"); | ||
int top; | ||
int bottom; | ||
boolean isUid; | ||
|
||
public MsgRangeFilter(String rng, boolean uid) { | ||
if (rng.indexOf(':') == -1) { | ||
int value = Integer.parseInt(rng); | ||
top = value; | ||
bottom = value; | ||
} else { | ||
Matcher mat = TWO_PART.matcher(rng); | ||
if(mat.matches() &&mat.groupCount() == 2) { | ||
String botGroup = mat.group(1); | ||
String topGroup = mat.group(2); | ||
if ("*".equals(botGroup)) { | ||
bottom = 0; | ||
} else { | ||
bottom = Integer.parseInt(botGroup); | ||
} | ||
|
||
if ("*".equals(topGroup)) { | ||
top = Integer.MAX_VALUE; | ||
} else { | ||
top = Integer.parseInt(topGroup); | ||
} | ||
} else { | ||
throw new IllegalStateException("Can not create range filter from "+rng+", uid="+uid); | ||
} | ||
} | ||
|
||
isUid = uid; | ||
} | ||
|
||
public boolean includes(int seq) { | ||
return seq >= bottom && seq <= top; | ||
} | ||
/* | ||
* Copyright (c) 2014 Wael Chatila / Icegreen Technologies. All Rights Reserved. | ||
* This software is released under the Apache license 2.0 | ||
* This file has been used and modified. | ||
* Original file can be found on http://foedus.sourceforge.net | ||
*/ | ||
package com.icegreen.greenmail.foedus.util; | ||
|
||
|
||
import java.util.regex.Matcher; | ||
import java.util.regex.Pattern; | ||
|
||
|
||
public class MsgRangeFilter { | ||
static final Pattern TWO_PART = Pattern.compile("(\\d+|\\*):(\\d+|\\*)"); | ||
int top; | ||
int bottom; | ||
boolean isUid; | ||
|
||
public MsgRangeFilter(String rng, boolean uid) { | ||
if (rng.indexOf(':') == -1) { | ||
int value = Integer.parseInt(rng); | ||
top = value; | ||
bottom = value; | ||
} else { | ||
Matcher mat = TWO_PART.matcher(rng); | ||
if(mat.matches() &&mat.groupCount() == 2) { | ||
String botGroup = mat.group(1); | ||
String topGroup = mat.group(2); | ||
if ("*".equals(botGroup)) { | ||
bottom = 0; | ||
} else { | ||
bottom = Integer.parseInt(botGroup); | ||
} | ||
|
||
if ("*".equals(topGroup)) { | ||
top = Integer.MAX_VALUE; | ||
} else { | ||
top = Integer.parseInt(topGroup); | ||
} | ||
} else { | ||
throw new IllegalStateException("Can not create range filter from "+rng+", uid="+uid); | ||
} | ||
} | ||
|
||
isUid = uid; | ||
} | ||
|
||
public boolean includes(int seq) { | ||
return seq >= bottom && seq <= top; | ||
} | ||
} |
Oops, something went wrong.