| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.common.util;
|
1 |
package com.spice.profitmandi.common.util;
|
| 2 |
|
2 |
|
| 3 |
import java.io.File;
|
3 |
import java.io.File;
|
| 4 |
import java.io.IOException;
|
4 |
import java.io.IOException;
|
| 5 |
import java.io.InputStream;
|
5 |
import java.io.InputStream;
|
| - |
|
6 |
import java.io.Serializable;
|
| 6 |
import java.net.URISyntaxException;
|
7 |
import java.net.URISyntaxException;
|
| 7 |
import java.net.URL;
|
8 |
import java.net.URL;
|
| 8 |
import java.util.ArrayList;
|
9 |
import java.util.ArrayList;
|
| 9 |
import java.util.Collections;
|
10 |
import java.util.Collections;
|
| 10 |
import java.util.HashMap;
|
11 |
import java.util.HashMap;
|
| Line 13... |
Line 14... |
| 13 |
import java.util.Map;
|
14 |
import java.util.Map;
|
| 14 |
import java.util.Set;
|
15 |
import java.util.Set;
|
| 15 |
import java.util.TreeSet;
|
16 |
import java.util.TreeSet;
|
| 16 |
|
17 |
|
| 17 |
import javax.mail.internet.InternetAddress;
|
18 |
import javax.mail.internet.InternetAddress;
|
| - |
|
19 |
import javax.mail.internet.MimeBodyPart;
|
| 18 |
import javax.mail.internet.MimeMessage;
|
20 |
import javax.mail.internet.MimeMessage;
|
| 19 |
|
21 |
|
| 20 |
import org.apache.commons.io.FileUtils;
|
22 |
import org.apache.commons.io.FileUtils;
|
| 21 |
import org.apache.commons.io.IOUtils;
|
23 |
import org.apache.commons.io.IOUtils;
|
| 22 |
import org.apache.http.client.utils.URIBuilder;
|
24 |
import org.apache.http.client.utils.URIBuilder;
|
| 23 |
import org.apache.logging.log4j.LogManager;
|
25 |
import org.apache.logging.log4j.LogManager;
|
| 24 |
import org.apache.logging.log4j.Logger;
|
26 |
import org.apache.logging.log4j.Logger;
|
| 25 |
import org.apache.thrift.TException;
|
27 |
import org.apache.thrift.TException;
|
| 26 |
import org.apache.thrift.transport.TTransportException;
|
28 |
import org.apache.thrift.transport.TTransportException;
|
| 27 |
import org.json.JSONObject;
|
- |
|
| 28 |
import org.springframework.core.io.InputStreamSource;
|
29 |
import org.springframework.core.io.InputStreamSource;
|
| 29 |
import org.springframework.http.HttpHeaders;
|
- |
|
| 30 |
import org.springframework.http.MediaType;
|
- |
|
| 31 |
import org.springframework.mail.javamail.JavaMailSender;
|
30 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 32 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
31 |
import org.springframework.mail.javamail.MimeMessageHelper;
|
| 33 |
|
32 |
|
| 34 |
import com.spice.profitmandi.common.enumuration.SchemeType;
|
- |
|
| 35 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
33 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 36 |
import com.spice.profitmandi.common.model.GstRate;
|
34 |
import com.spice.profitmandi.common.model.GstRate;
|
| 37 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
35 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 38 |
import com.spice.profitmandi.common.web.client.RestClient;
|
- |
|
| 39 |
import com.spice.profitmandi.thrift.clients.CatalogClient;
|
36 |
import com.spice.profitmandi.thrift.clients.CatalogClient;
|
| 40 |
import com.spice.profitmandi.thrift.clients.InventoryClient;
|
37 |
import com.spice.profitmandi.thrift.clients.InventoryClient;
|
| 41 |
import com.spice.profitmandi.thrift.clients.TransactionClient;
|
38 |
import com.spice.profitmandi.thrift.clients.TransactionClient;
|
| 42 |
import com.spice.profitmandi.thrift.clients.UserClient;
|
39 |
import com.spice.profitmandi.thrift.clients.UserClient;
|
| 43 |
import com.spice.profitmandi.thrift.clients.WarehouseClient;
|
40 |
import com.spice.profitmandi.thrift.clients.WarehouseClient;
|
| Line 68... |
Line 65... |
| 68 |
private static final Map<Integer, String> helpMap = new HashMap<>(6);
|
65 |
private static final Map<Integer, String> helpMap = new HashMap<>(6);
|
| 69 |
private static final Map<Integer, String> dthIdAliasMap = new HashMap<>(7);
|
66 |
private static final Map<Integer, String> dthIdAliasMap = new HashMap<>(7);
|
| 70 |
private static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<>(20);
|
67 |
private static Map<Long, List<RechargePlan>> operatorPlanMap = new HashMap<>(20);
|
| 71 |
private static Map<Long, String> mobileProvidersMap;
|
68 |
private static Map<Long, String> mobileProvidersMap;
|
| 72 |
private static Map<Long, String> dthProvidersMap;
|
69 |
private static Map<Long, String> dthProvidersMap;
|
| - |
|
70 |
// private static final String SMS_GATEWAY =
|
| 73 |
//private static final String SMS_GATEWAY = "http://103.15.179.45:8085/SMSGateway/sendingSMS";
|
71 |
// "http://103.15.179.45:8085/SMSGateway/sendingSMS";
|
| 74 |
private static final String SMS_GATEWAY = "http://103.15.179.45:8085/MessagingGateway/SendTransSMS";
|
72 |
private static final String SMS_GATEWAY = "http://103.15.179.45:8085/MessagingGateway/SendTransSMS";
|
| 75 |
private static Map<Long, String> allProviders;
|
73 |
private static Map<Long, String> allProviders;
|
| 76 |
public static Map<RechargeOrderStatus, String> rechargeStatusMap = new HashMap<>();
|
74 |
public static Map<RechargeOrderStatus, String> rechargeStatusMap = new HashMap<>();
|
| 77 |
public static OrderStatusGroups ORDER_STATUS_GROUPS = new OrderStatusGroups();
|
75 |
public static OrderStatusGroups ORDER_STATUS_GROUPS = new OrderStatusGroups();
|
| 78 |
public static final String SYSTEM_PARTNER="testpxps@gmail.com";
|
76 |
public static final String SYSTEM_PARTNER = "testpxps@gmail.com";
|
| 79 |
|
77 |
|
| 80 |
static {
|
78 |
static {
|
| 81 |
helpMap.put(Integer.valueOf(1), "Your VC number starts with 0 and is 11 digits long.");
|
79 |
helpMap.put(Integer.valueOf(1), "Your VC number starts with 0 and is 11 digits long.");
|
| 82 |
helpMap.put(Integer.valueOf(2), "Smart card number starts with 2 and is 12 digits long.");
|
80 |
helpMap.put(Integer.valueOf(2), "Smart card number starts with 2 and is 12 digits long.");
|
| 83 |
helpMap.put(Integer.valueOf(3), "Smart card number starts with 4 and is 11 digits long.");
|
81 |
helpMap.put(Integer.valueOf(3), "Smart card number starts with 4 and is 11 digits long.");
|
| 84 |
helpMap.put(Integer.valueOf(4), "Subscriber ID starts with 1 and is 10 digits long.");
|
82 |
helpMap.put(Integer.valueOf(4), "Subscriber ID starts with 1 and is 10 digits long.");
|
| Line 232... |
Line 230... |
| 232 |
helper.addAttachment(file.getName(), file);
|
230 |
helper.addAttachment(file.getName(), file);
|
| 233 |
}
|
231 |
}
|
| 234 |
}
|
232 |
}
|
| 235 |
mailSender.send(message);
|
233 |
mailSender.send(message);
|
| 236 |
}
|
234 |
}
|
| - |
|
235 |
|
| 237 |
public static class Attachment {
|
236 |
public static class Attachment {
|
| 238 |
public Attachment(String fileName, InputStreamSource inputStreamSource) {
|
237 |
public Attachment(String fileName, InputStreamSource inputStreamSource) {
|
| 239 |
this.fileName = fileName;
|
238 |
this.fileName = fileName;
|
| 240 |
this.inputStreamSource = inputStreamSource;
|
239 |
this.inputStreamSource = inputStreamSource;
|
| 241 |
}
|
240 |
}
|
| 242 |
|
241 |
|
| 243 |
private String fileName;
|
242 |
private String fileName;
|
| 244 |
private InputStreamSource inputStreamSource;
|
243 |
private InputStreamSource inputStreamSource;
|
| 245 |
|
244 |
|
| 246 |
public String getFileName() {
|
245 |
public String getFileName() {
|
| 247 |
return fileName;
|
246 |
return fileName;
|
| 248 |
}
|
247 |
}
|
| - |
|
248 |
|
| 249 |
public void setFileName(String fileName) {
|
249 |
public void setFileName(String fileName) {
|
| 250 |
this.fileName = fileName;
|
250 |
this.fileName = fileName;
|
| 251 |
}
|
251 |
}
|
| - |
|
252 |
|
| 252 |
public InputStreamSource getInputStreamSource() {
|
253 |
public InputStreamSource getInputStreamSource() {
|
| 253 |
return inputStreamSource;
|
254 |
return inputStreamSource;
|
| 254 |
}
|
255 |
}
|
| - |
|
256 |
|
| 255 |
public void setInputStreamSource(InputStreamSource inputStreamSource) {
|
257 |
public void setInputStreamSource(InputStreamSource inputStreamSource) {
|
| 256 |
this.inputStreamSource = inputStreamSource;
|
258 |
this.inputStreamSource = inputStreamSource;
|
| 257 |
}
|
259 |
}
|
| - |
|
260 |
|
| 258 |
@Override
|
261 |
@Override
|
| 259 |
public String toString() {
|
262 |
public String toString() {
|
| 260 |
return "Attachment [fileName=" + fileName + ", inputStreamSource=" + inputStreamSource + "]";
|
263 |
return "Attachment [fileName=" + fileName + ", inputStreamSource=" + inputStreamSource + "]";
|
| 261 |
}
|
264 |
}
|
| 262 |
}
|
265 |
}
|
| 263 |
|
266 |
|
| 264 |
public static void sendMailWithAttachment(JavaMailSender mailSender, String[] emailTo, String[] cc, String subject,
|
267 |
public static void sendMailWithAttachment(JavaMailSender mailSender, String[] emailTo, String[] cc, String subject,
|
| 265 |
String body, String fileName, InputStreamSource inputStreamSource) throws Exception {
|
268 |
String body, String fileName, InputStreamSource inputStreamSource) throws Exception {
|
| 266 |
MimeMessage message = mailSender.createMimeMessage();
|
269 |
MimeMessage message = mailSender.createMimeMessage();
|
| 267 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
270 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 268 |
helper.setSubject(subject);
|
271 |
helper.setSubject(subject);
|
| Line 274... |
Line 277... |
| 274 |
helper.addAttachment(fileName, inputStreamSource);
|
277 |
helper.addAttachment(fileName, inputStreamSource);
|
| 275 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
278 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
| 276 |
helper.setFrom(senderAddress);
|
279 |
helper.setFrom(senderAddress);
|
| 277 |
mailSender.send(message);
|
280 |
mailSender.send(message);
|
| 278 |
}
|
281 |
}
|
| 279 |
|
282 |
|
| 280 |
public static void sendMailWithAttachments(JavaMailSender mailSender, String[] emailTo, String[] cc, String subject,
|
283 |
public static void sendMailWithAttachments(JavaMailSender mailSender, String[] emailTo, String[] cc, String subject,
|
| 281 |
String body, Attachment... attachments) throws Exception {
|
284 |
String body, Attachment... attachments) throws Exception {
|
| 282 |
MimeMessage message = mailSender.createMimeMessage();
|
285 |
MimeMessage message = mailSender.createMimeMessage();
|
| 283 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
286 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 284 |
helper.setSubject(subject);
|
287 |
helper.setSubject(subject);
|
| 285 |
helper.setText(body);
|
288 |
helper.setText(body);
|
| 286 |
if (cc != null) {
|
289 |
if (cc != null) {
|
| 287 |
helper.setCc(cc);
|
290 |
helper.setCc(cc);
|
| 288 |
}
|
291 |
}
|
| 289 |
helper.setTo(emailTo);
|
292 |
helper.setTo(emailTo);
|
| 290 |
for(Attachment attachment: attachments ) {
|
293 |
for (Attachment attachment : attachments) {
|
| 291 |
helper.addAttachment(attachment.getFileName(), attachment.getInputStreamSource());
|
294 |
helper.addAttachment(attachment.getFileName(), attachment.getInputStreamSource());
|
| 292 |
}
|
295 |
}
|
| 293 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
296 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
| 294 |
helper.setFrom(senderAddress);
|
297 |
helper.setFrom(senderAddress);
|
| 295 |
mailSender.send(message);
|
298 |
mailSender.send(message);
|
| 296 |
}
|
299 |
}
|
| 297 |
|
300 |
|
| 298 |
public static void sendHtmlMailWithAttachments(JavaMailSender mailSender, String[] emailTo, String[] cc, String subject,
|
301 |
public static void sendHtmlMailWithAttachments(JavaMailSender mailSender, String[] emailTo, String[] cc,
|
| 299 |
String body, Attachment... attachments) throws Exception {
|
302 |
String subject, String body, Attachment... attachments) throws Exception {
|
| 300 |
MimeMessage message = mailSender.createMimeMessage();
|
303 |
MimeMessage message = mailSender.createMimeMessage();
|
| 301 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
304 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 302 |
helper.setSubject(subject);
|
305 |
helper.setSubject(subject);
|
| 303 |
message.setContent(body, "text/html");
|
306 |
message.setContent(body, "text/html");
|
| 304 |
//helper.setText(body, true);
|
307 |
// helper.setText(body, true);
|
| 305 |
if (cc != null) {
|
308 |
if (cc != null) {
|
| 306 |
helper.setCc(cc);
|
309 |
helper.setCc(cc);
|
| 307 |
}
|
310 |
}
|
| 308 |
helper.setTo(emailTo);
|
311 |
helper.setTo(emailTo);
|
| 309 |
for(Attachment attachment: attachments ) {
|
312 |
for (Attachment attachment : attachments) {
|
| 310 |
if(attachment==null) break;
|
313 |
if (attachment == null)
|
| - |
|
314 |
break;
|
| 311 |
helper.addAttachment(attachment.getFileName(), attachment.getInputStreamSource());
|
315 |
helper.addAttachment(attachment.getFileName(), attachment.getInputStreamSource());
|
| 312 |
}
|
316 |
}
|
| 313 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
317 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "SmartDukaan Care");
|
| 314 |
helper.setFrom(senderAddress);
|
318 |
helper.setFrom(senderAddress);
|
| 315 |
mailSender.send(message);
|
319 |
mailSender.send(message);
|
| Line 350... |
Line 354... |
| 350 |
}
|
354 |
}
|
| 351 |
|
355 |
|
| 352 |
public static String getIconUrl(int entityId, String host, int port, String webapp) {
|
356 |
public static String getIconUrl(int entityId, String host, int port, String webapp) {
|
| 353 |
return "";
|
357 |
return "";
|
| 354 |
}
|
358 |
}
|
| 355 |
|
359 |
|
| 356 |
public static Map<Integer, GstRate> getStateTaxRate(List<Integer> itemIds, int stateId) throws ProfitMandiBusinessException{
|
360 |
public static Map<Integer, GstRate> getStateTaxRate(List<Integer> itemIds, int stateId)
|
| - |
|
361 |
throws ProfitMandiBusinessException {
|
| 357 |
List<Long> longItemIds = new ArrayList<>();
|
362 |
List<Long> longItemIds = new ArrayList<>();
|
| 358 |
for(int itemId : itemIds){
|
363 |
for (int itemId : itemIds) {
|
| 359 |
longItemIds.add(Long.valueOf(itemId));
|
364 |
longItemIds.add(Long.valueOf(itemId));
|
| 360 |
}
|
365 |
}
|
| 361 |
try{
|
366 |
try {
|
| 362 |
CatalogService.Client catalogClient = getCatalogClient();
|
367 |
CatalogService.Client catalogClient = getCatalogClient();
|
| 363 |
Map<Long, in.shop2020.model.v1.catalog.GstRate> totalTaxRateMap = catalogClient.getStateTaxRate(longItemIds, stateId);
|
368 |
Map<Long, in.shop2020.model.v1.catalog.GstRate> totalTaxRateMap = catalogClient.getStateTaxRate(longItemIds,
|
| - |
|
369 |
stateId);
|
| 364 |
Map<Integer, GstRate> itemIdGstRateMap = new HashMap<>();
|
370 |
Map<Integer, GstRate> itemIdGstRateMap = new HashMap<>();
|
| 365 |
for(Map.Entry<Long, in.shop2020.model.v1.catalog.GstRate> totalTaxRateEntry : totalTaxRateMap.entrySet()){
|
371 |
for (Map.Entry<Long, in.shop2020.model.v1.catalog.GstRate> totalTaxRateEntry : totalTaxRateMap.entrySet()) {
|
| 366 |
GstRate gstRate = new GstRate();
|
372 |
GstRate gstRate = new GstRate();
|
| 367 |
gstRate.setIgstRate(Double.valueOf(totalTaxRateEntry.getValue().getIgstRate()).floatValue());
|
373 |
gstRate.setIgstRate(Double.valueOf(totalTaxRateEntry.getValue().getIgstRate()).floatValue());
|
| 368 |
gstRate.setCgstRate(Double.valueOf(totalTaxRateEntry.getValue().getCgstRate()).floatValue());
|
374 |
gstRate.setCgstRate(Double.valueOf(totalTaxRateEntry.getValue().getCgstRate()).floatValue());
|
| 369 |
gstRate.setSgstRate(Double.valueOf(totalTaxRateEntry.getValue().getSgstRate()).floatValue());
|
375 |
gstRate.setSgstRate(Double.valueOf(totalTaxRateEntry.getValue().getSgstRate()).floatValue());
|
| 370 |
itemIdGstRateMap.put(totalTaxRateEntry.getKey().intValue(), gstRate);
|
376 |
itemIdGstRateMap.put(totalTaxRateEntry.getKey().intValue(), gstRate);
|
| 371 |
}
|
377 |
}
|
| 372 |
return itemIdGstRateMap;
|
378 |
return itemIdGstRateMap;
|
| 373 |
}catch(Exception e){
|
379 |
} catch (Exception e) {
|
| 374 |
e.printStackTrace();
|
380 |
e.printStackTrace();
|
| 375 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID + ", " + ProfitMandiConstants.STATE_ID, itemIds +", " + stateId, "THRFT_1000");
|
381 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID + ", " + ProfitMandiConstants.STATE_ID,
|
| - |
|
382 |
itemIds + ", " + stateId, "THRFT_1000");
|
| 376 |
}
|
383 |
}
|
| 377 |
}
|
384 |
}
|
| 378 |
|
385 |
|
| 379 |
public static Map<Integer, Float> getIgstTaxRate(List<Integer> itemIds) throws ProfitMandiBusinessException{
|
386 |
public static Map<Integer, Float> getIgstTaxRate(List<Integer> itemIds) throws ProfitMandiBusinessException {
|
| 380 |
List<Long> longItemIds = new ArrayList<>();
|
387 |
List<Long> longItemIds = new ArrayList<>();
|
| 381 |
for(int itemId : itemIds){
|
388 |
for (int itemId : itemIds) {
|
| 382 |
longItemIds.add(Long.valueOf(itemId));
|
389 |
longItemIds.add(Long.valueOf(itemId));
|
| 383 |
}
|
390 |
}
|
| 384 |
try{
|
391 |
try {
|
| 385 |
CatalogService.Client catalogClient = getCatalogClient();
|
392 |
CatalogService.Client catalogClient = getCatalogClient();
|
| 386 |
Map<Long, Double> totalTaxRateMap = catalogClient.getIgstTaxRate(longItemIds);
|
393 |
Map<Long, Double> totalTaxRateMap = catalogClient.getIgstTaxRate(longItemIds);
|
| 387 |
Map<Integer, Float> itemIdIgstRateMap = new HashMap<>();
|
394 |
Map<Integer, Float> itemIdIgstRateMap = new HashMap<>();
|
| 388 |
for(Map.Entry<Long, Double> totalTaxRateEntry : totalTaxRateMap.entrySet()){
|
395 |
for (Map.Entry<Long, Double> totalTaxRateEntry : totalTaxRateMap.entrySet()) {
|
| 389 |
itemIdIgstRateMap.put(totalTaxRateEntry.getKey().intValue(), 12f);
|
396 |
itemIdIgstRateMap.put(totalTaxRateEntry.getKey().intValue(), 12f);
|
| 390 |
}
|
397 |
}
|
| 391 |
return itemIdIgstRateMap;
|
398 |
return itemIdIgstRateMap;
|
| 392 |
}catch(Exception e){
|
399 |
} catch (Exception e) {
|
| 393 |
e.printStackTrace();
|
400 |
e.printStackTrace();
|
| 394 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID, itemIds, "THRFT_1001");
|
401 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID, itemIds, "THRFT_1001");
|
| 395 |
}
|
402 |
}
|
| 396 |
}
|
403 |
}
|
| 397 |
|
404 |
|
| 398 |
private static CatalogService.Client getCatalogClient() throws Exception{
|
405 |
private static CatalogService.Client getCatalogClient() throws Exception {
|
| 399 |
try{
|
406 |
try {
|
| 400 |
CatalogClient client = new CatalogClient();
|
407 |
CatalogClient client = new CatalogClient();
|
| 401 |
CatalogService.Client catalogClient = client.getClient();
|
408 |
CatalogService.Client catalogClient = client.getClient();
|
| 402 |
return catalogClient;
|
409 |
return catalogClient;
|
| 403 |
}catch (Exception e) {
|
410 |
} catch (Exception e) {
|
| 404 |
throw e;
|
411 |
throw e;
|
| 405 |
}
|
412 |
}
|
| 406 |
}
|
413 |
}
|
| 407 |
|
414 |
|
| 408 |
private static WarehouseService.Client getWarehouseClient() throws Exception {
|
415 |
private static WarehouseService.Client getWarehouseClient() throws Exception {
|
| Line 548... |
Line 555... |
| 548 |
public static WarehouseAddress getWarehouseByWarehouseId(int warehouseAddressId) throws Exception {
|
555 |
public static WarehouseAddress getWarehouseByWarehouseId(int warehouseAddressId) throws Exception {
|
| 549 |
TransactionClient tcl = new TransactionClient();
|
556 |
TransactionClient tcl = new TransactionClient();
|
| 550 |
return tcl.getClient().getWarehouseAddress((long) warehouseAddressId);
|
557 |
return tcl.getClient().getWarehouseAddress((long) warehouseAddressId);
|
| 551 |
}
|
558 |
}
|
| 552 |
|
559 |
|
| - |
|
560 |
public static void sendEmbeddedHtmlMail(JavaMailSender mailSender, String[] strings, String[] strings2,
|
| - |
|
561 |
String format, String string, Map<? extends Serializable, File> map) throws Exception {
|
| - |
|
562 |
for(Map.Entry<? extends Serializable, File> entry: map.entrySet()) {
|
| - |
|
563 |
entry.getKey();
|
| - |
|
564 |
entry.getValue();
|
| - |
|
565 |
MimeBodyPart imagePart = new MimeBodyPart();
|
| - |
|
566 |
imagePart.setHeader("Content-ID", entry.getKey() + "");
|
| - |
|
567 |
imagePart.setDisposition(MimeBodyPart.INLINE);
|
| - |
|
568 |
imagePart.attachFile(entry.getValue());
|
| - |
|
569 |
}
|
| - |
|
570 |
// attach the image file
|
| - |
|
571 |
|
| - |
|
572 |
}
|
| - |
|
573 |
|
| 553 |
}
|
574 |
}
|