mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-15 11:07:57 +01:00
Minor java 8 refactors.
This commit is contained in:
parent
0cc08b34cf
commit
12f2048fa2
@ -63,10 +63,10 @@ public class FreemindExporter
|
||||
export(map.getUnzipXml(), outputStream);
|
||||
}
|
||||
|
||||
public void export(byte[] xml, @NotNull OutputStream outputStream) throws ExportException {
|
||||
public void export(@NotNull byte[] xml, @NotNull OutputStream outputStream) throws ExportException {
|
||||
|
||||
objectFactory = new com.wisemapping.jaxb.freemind.ObjectFactory();
|
||||
nodesMap = new HashMap<String, Node>();
|
||||
nodesMap = new HashMap<>();
|
||||
final com.wisemapping.jaxb.wisemap.Map mindmapMap;
|
||||
|
||||
try {
|
||||
@ -124,15 +124,7 @@ public class FreemindExporter
|
||||
}
|
||||
|
||||
JAXBUtils.saveMap(freemindMap, outputStream);
|
||||
} catch (JAXBException e) {
|
||||
throw new ExportException(e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new ExportException(e);
|
||||
} catch (SAXException e) {
|
||||
throw new ExportException(e);
|
||||
} catch (ParserConfigurationException e) {
|
||||
throw new ExportException(e);
|
||||
} catch (IOException e) {
|
||||
} catch (JAXBException | SAXException | IOException | ParserConfigurationException e) {
|
||||
throw new ExportException(e);
|
||||
}
|
||||
}
|
||||
|
@ -53,10 +53,8 @@ public final class Mailer {
|
||||
|
||||
public void sendEmail(final String from, final String to, final String subject, final Map model,
|
||||
@NotNull final String templateMail) {
|
||||
final MimeMessagePreparator preparator =
|
||||
new MimeMessagePreparator() {
|
||||
public void prepare(MimeMessage mimeMessage)
|
||||
throws Exception {
|
||||
|
||||
this.mailSender.send(mimeMessage -> {
|
||||
final MimeMessageHelper message = new MimeMessageHelper(mimeMessage);
|
||||
message.setTo(to);
|
||||
message.setFrom(from);
|
||||
@ -64,10 +62,7 @@ public final class Mailer {
|
||||
|
||||
final String messageBody = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine, "/mail/" + templateMail, model);
|
||||
message.setText(messageBody, true);
|
||||
}
|
||||
};
|
||||
|
||||
this.mailSender.send(preparator);
|
||||
});
|
||||
}
|
||||
|
||||
public void setMailSender(JavaMailSender mailer) {
|
||||
|
@ -215,7 +215,7 @@ public class MindmapIcons {
|
||||
private static void load() {
|
||||
try {
|
||||
if (iconsByFamily == null) {
|
||||
iconsByFamily = new TreeMap<IconFamily, List<MindmapIcon>>();
|
||||
iconsByFamily = new TreeMap<>();
|
||||
|
||||
Field[] fields = MindmapIcons.class.getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
|
Loading…
Reference in New Issue
Block a user