| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
|
|
| 8 |
|
|
| 9 |
|
|
| 10 |
|
|
| 11 |
|
|
| 12 |
|
|
| 13 |
|
|
| 14 |
|
|
| 15 |
|
|
| 16 |
|
|
| 17 |
|
|
| 18 |
|
|
| 19 |
|
|
| 20 |
|
package org.xwiki.mail.internal; |
| 21 |
|
|
| 22 |
|
import javax.inject.Inject; |
| 23 |
|
import javax.inject.Named; |
| 24 |
|
import javax.inject.Singleton; |
| 25 |
|
|
| 26 |
|
import org.xwiki.component.annotation.Component; |
| 27 |
|
import org.xwiki.configuration.ConfigurationSource; |
| 28 |
|
import org.xwiki.mail.MailStorageConfiguration; |
| 29 |
|
|
| 30 |
|
|
| 31 |
|
|
| 32 |
|
|
| 33 |
|
@version |
| 34 |
|
@since |
| 35 |
|
|
| 36 |
|
@Component |
| 37 |
|
@Singleton |
| |
|
| 100% |
Uncovered Elements: 0 (7) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 38 |
|
public class DefaultMailStorageConfiguration implements MailStorageConfiguration |
| 39 |
|
{ |
| 40 |
|
|
| 41 |
|
|
| 42 |
|
|
| 43 |
|
private static final String PREFIX = "mail.sender.database."; |
| 44 |
|
|
| 45 |
|
private static final String DISCARD_SUCCESS_STATUSES = "discardSuccessStatuses"; |
| 46 |
|
|
| 47 |
|
@Inject |
| 48 |
|
@Named("mailsend") |
| 49 |
|
private ConfigurationSource mailConfigSource; |
| 50 |
|
|
| 51 |
|
@Inject |
| 52 |
|
@Named("xwikiproperties") |
| 53 |
|
private ConfigurationSource xwikiPropertiesSource; |
| 54 |
|
|
| |
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 2 |
Complexity Density: 0.5 |
|
| 55 |
8 |
@Override... |
| 56 |
|
public boolean discardSuccessStatuses() |
| 57 |
|
{ |
| 58 |
|
|
| 59 |
8 |
Integer discardSuccessStatuses = this.mailConfigSource.getProperty(DISCARD_SUCCESS_STATUSES); |
| 60 |
|
|
| 61 |
8 |
if (discardSuccessStatuses == null) { |
| 62 |
4 |
discardSuccessStatuses = this.xwikiPropertiesSource.getProperty(PREFIX + DISCARD_SUCCESS_STATUSES, 1); |
| 63 |
|
} |
| 64 |
|
|
| 65 |
8 |
return (discardSuccessStatuses == 1); |
| 66 |
|
} |
| 67 |
|
} |