Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passage/feature/add support attach for mail client #21

Merged
merged 29 commits into from
Nov 3, 2019
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
de9e373
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
59637aa
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
109c7e7
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
aa6d6bd
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
ff22f97
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
ad579d0
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
1339aa2
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
7a280ff
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
a35ce28
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
8686b23
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
f8519f4
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 4, 2019
a3ce59a
Bug 550956 - [Passage] Support mail attachment
serjiokov Oct 6, 2019
4050bf0
Bug 550956 - [Passage] Support mail attachment …
serjiokov Oct 11, 2019
6f1713c
Bug 550956 - [Passage] Support mail attachment …
serjiokov Oct 13, 2019
aa3a8c5
Bug 550956 - [Passage] Support mail attachment …
serjiokov Oct 14, 2019
d46e507
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Oct 21, 2019
32e492f
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Oct 21, 2019
51ac48e
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Oct 21, 2019
4c29a6e
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Oct 21, 2019
4e8cb45
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Oct 21, 2019
1d05ee7
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 2, 2019
28e383c
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 2, 2019
f678a5a
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
057ea4c
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
2320306
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
472b4cb
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
81ff675
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
66aca83
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
9394532
Bug 550956 - [Passage] Support mail attachment
ruspl-afed Nov 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bug 550956 - [Passage] Support mail attachment
Extract org.eclipse.passage.lic.email bundle

Signed-off-by: Alexander Fedorov <[email protected]>
ruspl-afed committed Nov 3, 2019
commit 66aca83f2d1394bdb0e3b1c8a9332c0da94c8a96
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=warning
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unstableAutoModuleName=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
cleanup.add_default_serial_version_id=true
cleanup.add_generated_serial_version_id=false
cleanup.add_missing_annotations=true
cleanup.add_missing_deprecated_annotations=true
cleanup.add_missing_methods=false
cleanup.add_missing_nls_tags=false
cleanup.add_missing_override_annotations=true
cleanup.add_missing_override_annotations_interface_methods=true
cleanup.add_serial_version_id=false
cleanup.always_use_blocks=true
cleanup.always_use_parentheses_in_expressions=false
cleanup.always_use_this_for_non_static_field_access=false
cleanup.always_use_this_for_non_static_method_access=false
cleanup.convert_functional_interfaces=false
cleanup.convert_to_enhanced_for_loop=false
cleanup.correct_indentation=false
cleanup.format_source_code=false
cleanup.format_source_code_changes_only=false
cleanup.insert_inferred_type_arguments=false
cleanup.make_local_variable_final=true
cleanup.make_parameters_final=false
cleanup.make_private_fields_final=true
cleanup.make_type_abstract_if_missing_method=false
cleanup.make_variable_declarations_final=false
cleanup.never_use_blocks=false
cleanup.never_use_parentheses_in_expressions=true
cleanup.organize_imports=false
cleanup.qualify_static_field_accesses_with_declaring_class=false
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
cleanup.qualify_static_member_accesses_with_declaring_class=true
cleanup.qualify_static_method_accesses_with_declaring_class=false
cleanup.remove_private_constructors=true
cleanup.remove_redundant_modifiers=false
cleanup.remove_redundant_semicolons=false
cleanup.remove_redundant_type_arguments=false
cleanup.remove_trailing_whitespaces=false
cleanup.remove_trailing_whitespaces_all=true
cleanup.remove_trailing_whitespaces_ignore_empty=false
cleanup.remove_unnecessary_casts=true
cleanup.remove_unnecessary_nls_tags=true
cleanup.remove_unused_imports=true
cleanup.remove_unused_local_variables=false
cleanup.remove_unused_private_fields=true
cleanup.remove_unused_private_members=false
cleanup.remove_unused_private_methods=true
cleanup.remove_unused_private_types=true
cleanup.sort_members=false
cleanup.sort_members_all=false
cleanup.use_anonymous_class_creation=false
cleanup.use_blocks=false
cleanup.use_blocks_only_for_return_and_throw=false
cleanup.use_lambda=true
cleanup.use_parentheses_in_expressions=false
cleanup.use_this_for_non_static_field_access=false
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
cleanup.use_this_for_non_static_method_access=false
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
cleanup_profile=org.eclipse.jdt.ui.default.eclipse_clean_up_profile
cleanup_settings_version=2
eclipse.preferences.version=1
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
org.eclipse.jdt.ui.text.custom_code_templates=
sp_cleanup.add_default_serial_version_id=true
sp_cleanup.add_generated_serial_version_id=false
sp_cleanup.add_missing_annotations=true
sp_cleanup.add_missing_deprecated_annotations=true
sp_cleanup.add_missing_methods=false
sp_cleanup.add_missing_nls_tags=false
sp_cleanup.add_missing_override_annotations=true
sp_cleanup.add_missing_override_annotations_interface_methods=true
sp_cleanup.add_serial_version_id=false
sp_cleanup.always_use_blocks=true
sp_cleanup.always_use_parentheses_in_expressions=false
sp_cleanup.always_use_this_for_non_static_field_access=false
sp_cleanup.always_use_this_for_non_static_method_access=false
sp_cleanup.convert_functional_interfaces=false
sp_cleanup.convert_to_enhanced_for_loop=false
sp_cleanup.correct_indentation=false
sp_cleanup.format_source_code=true
sp_cleanup.format_source_code_changes_only=false
sp_cleanup.insert_inferred_type_arguments=false
sp_cleanup.make_local_variable_final=true
sp_cleanup.make_parameters_final=false
sp_cleanup.make_private_fields_final=true
sp_cleanup.make_type_abstract_if_missing_method=false
sp_cleanup.make_variable_declarations_final=false
sp_cleanup.never_use_blocks=false
sp_cleanup.never_use_parentheses_in_expressions=true
sp_cleanup.on_save_use_additional_actions=true
sp_cleanup.organize_imports=true
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
sp_cleanup.remove_private_constructors=true
sp_cleanup.remove_redundant_modifiers=false
sp_cleanup.remove_redundant_semicolons=false
sp_cleanup.remove_redundant_type_arguments=false
sp_cleanup.remove_trailing_whitespaces=false
sp_cleanup.remove_trailing_whitespaces_all=true
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
sp_cleanup.remove_unnecessary_casts=true
sp_cleanup.remove_unnecessary_nls_tags=false
sp_cleanup.remove_unused_imports=false
sp_cleanup.remove_unused_local_variables=false
sp_cleanup.remove_unused_private_fields=true
sp_cleanup.remove_unused_private_members=false
sp_cleanup.remove_unused_private_methods=true
sp_cleanup.remove_unused_private_types=true
sp_cleanup.sort_members=false
sp_cleanup.sort_members_all=false
sp_cleanup.use_anonymous_class_creation=false
sp_cleanup.use_blocks=false
sp_cleanup.use_blocks_only_for_return_and_throw=false
sp_cleanup.use_lambda=true
sp_cleanup.use_parentheses_in_expressions=false
sp_cleanup.use_this_for_non_static_field_access=false
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
sp_cleanup.use_this_for_non_static_method_access=false
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
classpath=true
dsVersion=V1_3
eclipse.preferences.version=1
enabled=true
generateBundleActivationPolicyLazy=true
path=OSGI-INF
validationErrorLevel=error
validationErrorLevel.missingImplicitUnbindMethod=error
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
compilers.f.unresolved-features=1
compilers.f.unresolved-plugins=1
compilers.incompatible-environment=1
compilers.p.build=1
compilers.p.build.bin.includes=1
compilers.p.build.encodings=2
compilers.p.build.java.compiler=2
compilers.p.build.java.compliance=1
compilers.p.build.missing.output=2
compilers.p.build.output.library=1
compilers.p.build.source.library=1
compilers.p.build.src.includes=1
compilers.p.deprecated=1
compilers.p.discouraged-class=1
compilers.p.internal=1
compilers.p.missing-packages=2
compilers.p.missing-version-export-package=2
compilers.p.missing-version-import-package=2
compilers.p.missing-version-require-bundle=1
compilers.p.no-required-att=0
compilers.p.no.automatic.module=1
compilers.p.not-externalized-att=0
compilers.p.service.component.without.lazyactivation=1
compilers.p.unknown-attribute=1
compilers.p.unknown-class=1
compilers.p.unknown-element=1
compilers.p.unknown-identifier=1
compilers.p.unknown-resource=1
compilers.p.unresolved-ex-points=0
compilers.p.unresolved-import=0
compilers.s.create-docs=false
compilers.s.doc-folder=doc
compilers.s.open-tags=1
eclipse.preferences.version=1
9 changes: 9 additions & 0 deletions bundles/org.eclipse.passage.lic.email/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.email
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.email
Bundle-Version: 0.1.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.passage.lic.email
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Properties file for org.eclipse.passage.lic.email
Bundle-Vendor = Eclipse Passage
Bundle-Name = Email
36 changes: 36 additions & 0 deletions bundles/org.eclipse.passage.lic.email/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>

<p>November 30, 2017</p>
<h3>License</h3>

<p>
The Eclipse Foundation makes available all content in this plug-in
(&quot;Content&quot;). Unless otherwise indicated below, the Content
is provided to you under the terms and conditions of the Eclipse
Public License Version 2.0 (&quot;EPL&quot;). A copy of the EPL is
available at <a href="http://www.eclipse.org/legal/epl-2.0">http://www.eclipse.org/legal/epl-2.0</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.
</p>

<p>
If you did not receive this Content directly from the Eclipse
Foundation, the Content is being redistributed by another party
(&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the
Redistributor's license that was provided with the Content. If no such
license exists, contact the Redistributor. Unless otherwise indicated
below, the terms and conditions of the EPL still apply to any source
code in the Content and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a>.
</p>

</body>
</html>
19 changes: 19 additions & 0 deletions bundles/org.eclipse.passage.lic.email/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
###############################################################################
# Copyright (c) 2019 ArSysOp and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0.
#
# SPDX-License-Identifier: EPL-2.0
#
# Contributors:
# ArSysOp - initial API and implementation
###############################################################################

source.. = src/
output.. = target/classes/
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
about.html
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
/**
* E-Mail Descriptor
*
* @since 0.6
* @since 0.1
*
*/
public interface EmailDescriptor {
Original file line number Diff line number Diff line change
@@ -13,19 +13,17 @@
package org.eclipse.passage.lic.email;

import java.io.OutputStream;
import java.util.function.Consumer;

import org.eclipse.core.runtime.IStatus;
import java.util.function.BiConsumer;

/**
* EMail service
*
* @since 0.6
* @since 0.1
*/

public interface Mailing {

public void writeEml(EmailDescriptor descriptor, OutputStream output, Consumer<IStatus> statusHandler);
public void writeEml(EmailDescriptor descriptor, OutputStream output, BiConsumer<String, Throwable> statusHandler);

public EmailDescriptor createMail(String to, String from, String subject, String body,
Iterable<String> attachments);
2 changes: 1 addition & 1 deletion bundles/org.eclipse.passage.lic.mail/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ Require-Bundle: javax.activation;bundle-version="0.0.0",
javax.mail;bundle-version="0.0.0",
org.eclipse.osgi.services;bundle-version="0.0.0",
org.eclipse.core.runtime;bundle-version="0.0.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0"
org.eclipse.passage.lic.email;bundle-version="0.0.0";visibility:=reexport
Export-Package: org.eclipse.passage.lic.internal.mail;x-internal=true
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/*.xml
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@
import java.io.File;
import java.io.IOException;
import java.io.OutputStream;
import java.util.function.Consumer;
import java.util.function.BiConsumer;

import javax.activation.DataHandler;
import javax.activation.DataSource;
@@ -30,8 +30,6 @@
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.passage.lic.email.EmailDescriptor;
import org.eclipse.passage.lic.email.Mailing;
import org.osgi.service.component.annotations.Component;
@@ -46,15 +44,13 @@
public class MailImpl implements Mailing {

@Override
public void writeEml(EmailDescriptor descriptor, OutputStream output, Consumer<IStatus> consumerStatus) {
public void writeEml(EmailDescriptor descriptor, OutputStream output, BiConsumer<String, Throwable> consumerStatus) {
try {
Message message = createMessage(descriptor);
fulfillMessage(descriptor, message);
message.writeTo(output);
} catch (MessagingException | IOException e) {
String pluginId = "org.eclipse.passage.lic.mail"; //$NON-NLS-1$
IStatus status = new Status(IStatus.ERROR, pluginId, e.getMessage(), e);
consumerStatus.accept(status);
consumerStatus.accept(e.getMessage(), e);
}
}

5 changes: 2 additions & 3 deletions bundles/org.eclipse.passage.lic.net/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -2,16 +2,15 @@ Manifest-Version: 1.0
Automatic-Module-Name: org.eclipse.passage.lic.net
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.passage.lic.net
Bundle-Version: 0.6.0.qualifier
Bundle-Version: 0.5.0.qualifier
Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.osgi.services;bundle-version="0.0.0",
org.eclipse.passage.lic.equinox;bundle-version="0.0.0"
Export-Package: org.eclipse.passage.lic.email,
org.eclipse.passage.lic.internal.net;x-internal:=true,
Export-Package: org.eclipse.passage.lic.internal.net;x-internal:=true,
org.eclipse.passage.lic.net
Bundle-ActivationPolicy: lazy
Service-Component: OSGI-INF/*.xml
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.osgi.services;bundle-version="0.0.0",
org.eclipse.emfforms.setup.base;bundle-version="0.0.0",
org.eclipse.passage.lic.emf;bundle-version="0.0.0",
org.eclipse.passage.lic.e4.core;bundle-version="0.0.0",
org.eclipse.passage.lic.net;bundle-version="0.0.0",
org.eclipse.passage.lic.email;bundle-version="0.0.0",
org.eclipse.passage.loc.api;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.loc.workbench;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.loc.workbench.emfforms;bundle-version="0.0.0";visibility:=reexport,
Original file line number Diff line number Diff line change
@@ -13,8 +13,8 @@ Require-Bundle: org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.passage.lic.emf;bundle-version="0.0.0",
org.eclipse.passage.lic.users.model;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.lic.licenses.model;bundle-version="0.0.0";visibility:=reexport,
org.eclipse.passage.loc.api;bundle-version="0.0.0",
org.eclipse.passage.lic.net
org.eclipse.passage.lic.email;bundle-version="0.0.0",
org.eclipse.passage.loc.api;bundle-version="0.0.0"
Export-Package: org.eclipse.passage.loc.internal.licenses.core;x-friends:="org.eclipse.passage.loc.dashboard.ui",
org.eclipse.passage.loc.internal.licenses.core.i18n;x-internal:=true,
org.eclipse.passage.loc.licenses.core
Original file line number Diff line number Diff line change
@@ -17,11 +17,10 @@
import java.io.IOException;
import java.util.Collections;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.BiConsumer;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.osgi.util.NLS;
import org.eclipse.passage.lic.email.EmailDescriptor;
import org.eclipse.passage.lic.email.Mailing;
@@ -114,10 +113,10 @@ public Optional<File> createEmlFile(File attachment) {
LicensesCoreMessages.LicenseRequest_mailto_subject_lbl, getDetails(MAILTO_SEPARATOR),
Collections.singleton(attachment.getPath()));

service.writeEml(descriptor, stream, new Consumer<IStatus>() {
service.writeEml(descriptor, stream, new BiConsumer<String, Throwable>() {
@Override
public void accept(IStatus t) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, t.getMessage());
public void accept(String message, Throwable t) {
Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, message, t);
}
});

7 changes: 7 additions & 0 deletions features/org.eclipse.passage.lic.net.feature/feature.xml
Original file line number Diff line number Diff line change
@@ -42,4 +42,11 @@
version="0.0.0"
unpack="false"/>

<plugin
id="org.eclipse.passage.lic.email"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>

</feature>
1 change: 1 addition & 0 deletions releng/org.eclipse.passage.lic.aggregator/pom.xml
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
<module>../../features/org.eclipse.passage.lic.bc.feature</module>

<module>../../bundles/org.eclipse.passage.lic.net</module>
<module>../../bundles/org.eclipse.passage.lic.email</module>
<module>../../features/org.eclipse.passage.lic.net.feature</module>

<module>../../bundles/org.eclipse.passage.lic.mail</module>
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ Bundle-Version: 0.1.0.qualifier
Automatic-Module-Name: org.eclipse.passage.lic.mail.tests
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.junit;bundle-version="4.12.0",
javax.mail;bundle-version="0.0.0",
org.eclipse.osgi;bundle-version="0.0.0",
org.eclipse.equinox.registry;bundle-version="3.8.200",
org.eclipse.equinox.common;bundle-version="0.0.0",
Original file line number Diff line number Diff line change
@@ -16,7 +16,6 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assume.assumeNoException;

@@ -30,10 +29,9 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;

import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import javax.mail.internet.AddressException;

import org.eclipse.passage.lic.email.EmailDescriptor;
import org.eclipse.passage.lic.email.Mailing;
import org.eclipse.passage.lic.internal.mail.MailImpl;
@@ -60,9 +58,7 @@ public void shouldCreateEmlByParametersPositiveTest() {
MAIL_BODY, Collections.singleton(attachment));
assertNotNull(mailDescriptor);
try (FileOutputStream fileOutput = new FileOutputStream(MAIL_FILE_OUT)) {
IStatus okStatus = new Status(IStatus.OK, this.getClass().getCanonicalName(), 0, "", null);
LicensingMailStatusConsumer statusConsumer = new LicensingMailStatusConsumer(okStatus);
mailing.writeEml(mailDescriptor, fileOutput, statusConsumer);
mailing.writeEml(mailDescriptor, fileOutput, (m, t) -> fail());
} catch (IOException e) {
assumeNoException(e);
}
@@ -76,9 +72,7 @@ public void shouldCreateEmlByParametersNagativeTest() {
EmailDescriptor mailDescriptor = mailing.createMail("", "", "", "", Collections.singleton(attachment));
assertNotNull(mailDescriptor);
try (FileOutputStream fileOutput = new FileOutputStream(MAIL_FILE_OUT)) {
IStatus errorStatus = new Status(IStatus.ERROR, this.getClass().getCanonicalName(), 1, "", null);
LicensingMailStatusConsumer statusConsumer = new LicensingMailStatusConsumer(errorStatus);
mailing.writeEml(mailDescriptor, fileOutput, statusConsumer);
mailing.writeEml(mailDescriptor, fileOutput, (m, t) -> assertEquals(AddressException.class, t.getClass()));
} catch (IOException e) {
assumeNoException(e);
}
@@ -117,16 +111,4 @@ public void removeAttachment() throws IOException {
}
}

class LicensingMailStatusConsumer implements Consumer<IStatus> {
private final IStatus expectedResult;

public LicensingMailStatusConsumer(IStatus status) {
expectedResult = status;
}

@Override
public void accept(IStatus t) {
assertTrue(expectedResult.getSeverity() == t.getSeverity());
}
}
}