-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MCR-3229 enable PMD rule LooseCoupling
- Loading branch information
Showing
154 changed files
with
759 additions
and
684 deletions.
There are no files selected for viewing
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
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
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
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
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
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 |
---|---|---|
|
@@ -78,12 +78,12 @@ | |
|
||
/** | ||
* This class provides methods to send emails from within a MyCoRe application. | ||
* | ||
* | ||
* @author Marc Schluepmann | ||
* @author Frank Lützenkirchen | ||
* @author Werner Greßhoff | ||
* @author René Adler (eagle) | ||
* | ||
* | ||
*/ | ||
public class MCRMailer extends MCRServlet { | ||
|
||
|
@@ -146,7 +146,7 @@ protected void doGetPost(MCRServletJob job) throws Exception { | |
|
||
/** | ||
* This method sends a simple plaintext email with the given parameters. | ||
* | ||
* | ||
* @param sender | ||
* the sender of the email | ||
* @param recipient | ||
|
@@ -159,15 +159,15 @@ protected void doGetPost(MCRServletJob job) throws Exception { | |
public static void send(String sender, String recipient, String subject, String body) { | ||
LOGGER.debug("Called plaintext send method with single recipient."); | ||
|
||
ArrayList<String> recipients = new ArrayList<>(); | ||
List<String> recipients = new ArrayList<>(); | ||
recipients.add(recipient); | ||
send(sender, null, recipients, null, subject, body, null); | ||
} | ||
|
||
/** | ||
* This method sends a simple plaintext email to more than one recipient. If | ||
* flag BCC is true, the sender will also get the email as BCC recipient. | ||
* | ||
* | ||
* @param sender | ||
* the sender of the email | ||
* @param recipients | ||
|
@@ -194,7 +194,7 @@ public static void send(String sender, List<String> recipients, String subject, | |
|
||
/** | ||
* This method sends a multipart email with the given parameters. | ||
* | ||
* | ||
* @param sender | ||
* the sender of the email | ||
* @param recipient | ||
|
@@ -209,15 +209,15 @@ public static void send(String sender, List<String> recipients, String subject, | |
public static void send(String sender, String recipient, String subject, String body, List<String> parts) { | ||
LOGGER.debug("Called multipart send method with single recipient."); | ||
|
||
ArrayList<String> recipients = new ArrayList<>(); | ||
List<String> recipients = new ArrayList<>(); | ||
recipients.add(recipient); | ||
send(sender, null, recipients, null, subject, body, parts); | ||
} | ||
|
||
/** | ||
* This method sends a multipart email to more than one recipient. If flag | ||
* BCC is true, the sender will also get the email as BCC recipient. | ||
* | ||
* | ||
* @param sender | ||
* the sender of the email | ||
* @param recipients | ||
|
@@ -302,8 +302,8 @@ public static void send(Element email, Boolean allowException) throws Exception | |
* Sends email. When sending email fails (for example, outgoing mail server | ||
* is not responding), sending will be retried after five minutes. This is | ||
* done up to 10 times. | ||
* | ||
* | ||
* | ||
* | ||
* @param from | ||
* the sender of the email | ||
* @param replyTo | ||
|
@@ -343,7 +343,7 @@ public static void send(final String from, final List<String> replyTo, final Lis | |
* Sends email. When sending email fails (for example, outgoing mail server | ||
* is not responding), sending will be retried after five minutes. This is | ||
* done up to 10 times. | ||
* | ||
* | ||
* @param mail the email | ||
*/ | ||
public static void send(EMail mail) { | ||
|
@@ -457,12 +457,12 @@ private static void setMessageContent(EMail mail, Multipart multipart) | |
/** | ||
* Generates e-mail from the given input document by transforming it with an xsl stylesheet, | ||
* and sends the e-mail afterwards. | ||
* | ||
* | ||
* @param input the xml input document | ||
* @param stylesheet the xsl stylesheet that will generate the e-mail, without the ending ".xsl" | ||
* @param stylesheet the xsl stylesheet that will generate the e-mail, without the ending ".xsl" | ||
* @param parameters the optionally empty table of xsl parameters | ||
* @return the generated e-mail | ||
* | ||
* | ||
* @see org.mycore.common.MCRMailer | ||
*/ | ||
public static Element sendMail(Document input, String stylesheet, Map<String, String> parameters) throws Exception { | ||
|
@@ -489,20 +489,20 @@ public static Element sendMail(Document input, String stylesheet, Map<String, St | |
/** | ||
* Generates e-mail from the given input document by transforming it with an xsl stylesheet, | ||
* and sends the e-mail afterwards. | ||
* | ||
* | ||
* @param input the xml input document | ||
* @param stylesheet the xsl stylesheet that will generate the e-mail, without the ending ".xsl" | ||
* @param stylesheet the xsl stylesheet that will generate the e-mail, without the ending ".xsl" | ||
* @return the generated e-mail | ||
* | ||
* | ||
* @see org.mycore.common.MCRMailer | ||
*/ | ||
public static Element sendMail(Document input, String stylesheet) throws Exception { | ||
return sendMail(input, stylesheet, Collections.emptyMap()); | ||
} | ||
|
||
/** | ||
/** | ||
* Transforms the given input element using xsl stylesheet. | ||
* | ||
* | ||
* @param input the input document to transform. | ||
* @param stylesheet the name of the xsl stylesheet to use, without the ".xsl" ending. | ||
* @param parameters the optionally empty table of xsl parameters | ||
|
@@ -561,7 +561,7 @@ private static JAXBContext initContext() { | |
|
||
/** | ||
* Parse a email from given {@link Element}. | ||
* | ||
* | ||
* @param xml the email | ||
* @return the {@link EMail} object | ||
*/ | ||
|
@@ -578,7 +578,7 @@ public static EMail parseXML(final Element xml) { | |
* Builds email address from a string. The string may be a single email | ||
* address or a combination of a personal name and address, like "John Doe" | ||
* <[email protected]> | ||
* | ||
* | ||
* @param s the email address string | ||
* @return a {@link InternetAddress} | ||
* @throws Exception throws AddressException or UnsupportedEncodingException | ||
|
@@ -600,7 +600,7 @@ private static InternetAddress buildAddress(String s) throws Exception { | |
|
||
/** | ||
* Builds a list of email addresses from a string list. | ||
* | ||
* | ||
* @param addresses the list with email addresses | ||
* @return a list of {@link InternetAddress}s | ||
* @see MCRMailer.EMail#buildAddress(String) | ||
|
@@ -617,7 +617,7 @@ private static Optional<List<InternetAddress>> buildAddressList(final List<Strin | |
|
||
/** | ||
* Returns the text message part. | ||
* | ||
* | ||
* @return the text message part | ||
*/ | ||
public Optional<MessagePart> getTextMessage() { | ||
|
@@ -627,7 +627,7 @@ public Optional<MessagePart> getTextMessage() { | |
|
||
/** | ||
* Returns the HTML message part. | ||
* | ||
* | ||
* @return the HTML message part | ||
*/ | ||
public Optional<MessagePart> getHTMLMessage() { | ||
|
@@ -637,7 +637,7 @@ public Optional<MessagePart> getHTMLMessage() { | |
|
||
/** | ||
* Returns the {@link EMail} as XML. | ||
* | ||
* | ||
* @return the XML | ||
*/ | ||
public Document toXML() { | ||
|
Oops, something went wrong.