-
Notifications
You must be signed in to change notification settings - Fork 600
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency to commons.lang for Cloud Service
- Loading branch information
Showing
10 changed files
with
170 additions
and
13 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
43 changes: 43 additions & 0 deletions
43
bundle-cloud/src/main/java/com/adobe/acs/commons/email/impl/MailTemplateManagerImpl.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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* #%L | ||
* ACS AEM Commons Bundle | ||
* %% | ||
* Copyright (C) 2024 Adobe | ||
* %% | ||
* Licensed 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. | ||
* #L% | ||
*/ | ||
package com.adobe.acs.commons.email.impl; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
import javax.mail.MessagingException; | ||
|
||
import org.apache.commons.mail.Email; | ||
import org.apache.commons.mail.EmailException; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
import com.day.cq.commons.mail.MailTemplate; | ||
|
||
@Component(service = MailTemplateManager.class) | ||
public class MailTemplateManagerImpl implements MailTemplateManager { | ||
|
||
@Override | ||
public <T extends Email> T getEmail(final MailTemplate template, | ||
final Map<String, String> params, | ||
final Class<T> mailType) | ||
throws IOException, EmailException, MessagingException { | ||
return template.getEmail(params, mailType); | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
bundle-onprem/src/main/java/com/adobe/acs/commons/email/impl/MailTemplateManagerImpl.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* #%L | ||
* ACS AEM Commons Bundle | ||
* %% | ||
* Copyright (C) 2024 Adobe | ||
* %% | ||
* Licensed 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. | ||
* #L% | ||
*/ | ||
package com.adobe.acs.commons.email.impl; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
import javax.mail.MessagingException; | ||
|
||
import org.apache.commons.lang.text.StrLookup; | ||
import org.apache.commons.mail.Email; | ||
import org.apache.commons.mail.EmailException; | ||
import org.osgi.service.component.annotations.Component; | ||
|
||
import com.day.cq.commons.mail.MailTemplate; | ||
|
||
@Component(service = MailTemplateManager.class) | ||
public class MailTemplateManagerImpl implements MailTemplateManager { | ||
|
||
@Override | ||
public <T extends Email> T getEmail(final MailTemplate template, | ||
final Map<String, String> params, | ||
final Class<T> mailType) | ||
throws IOException, EmailException, MessagingException { | ||
return template.getEmail(StrLookup.mapLookup(params), mailType); | ||
} | ||
} |
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
34 changes: 34 additions & 0 deletions
34
bundle/src/main/java/com/adobe/acs/commons/email/impl/MailTemplateManager.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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* ACS AEM Commons | ||
* | ||
* Copyright (C) 2024 Adobe | ||
* | ||
* Licensed 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 com.adobe.acs.commons.email.impl; | ||
|
||
import java.io.IOException; | ||
import java.util.Map; | ||
|
||
import javax.mail.MessagingException; | ||
|
||
import org.apache.commons.mail.Email; | ||
import org.apache.commons.mail.EmailException; | ||
|
||
import com.day.cq.commons.mail.MailTemplate; | ||
|
||
public interface MailTemplateManager { | ||
|
||
<T extends Email> T getEmail(MailTemplate template, final Map<String, String> params, Class<T> mailType) | ||
throws IOException, EmailException, MessagingException; | ||
} |
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