Could you please explain your design..?
How did you implement the lock/unlocl
did you include dynamic code downloading?
Also, do you have a feeling for what it was that Sun particularly liked about your project?
// Get system properties
Properties props = System.getProperties();
System.out.println("sendEmailWithAttachment - 1");
// Setup mail server
props.put("mail.smtp.host", smtpServer);
System.out.println("sendEmailWithAttachment - 2");
// Get session
//Session session = Session.getInstance(props, null);
Session session = Session.getDefaultInstance(props, null);
System.out.println("sendEmailWithAttachment - 3");
// Define message
MimeMessage message = new MimeMessage(session);
message.setFrom( new InternetAddress(msgFrom) );
message.addRecipient( Message.RecipientType.TO, new InternetAddress(msgTo) );
message.setSubject(msgSubject);
System.out.println("sendEmailWithAttachment - 4");
// create the message part
MimeBodyPart messageBodyPart = new MimeBodyPart();
System.out.println("sendEmailWithAttachment - 5");
//fill message
messageBodyPart.setText(msgBody);
System.out.println("sendEmailWithAttachment - 6");
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messageBodyPart);
System.out.println("sendEmailWithAttachment - 7");
// Part two is attachment
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(attachmentName);
messageBodyPart.setDataHandler( new DataHandler(source) );
messageBodyPart.setFileName(attachmentName);
//messageBodyPart.setFileName("dt.txt");
multipart.addBodyPart(messageBodyPart);
System.out.println("sendEmailWithAttachment - 8");
// Put parts in message
message.setContent(multipart);
message.setSentDate(new Date());
System.out.println("sendEmailWithAttachment - 9");
// Send the message
Transport.send( message );
you have to think about the reasons why you will subclass rather than modify !
For instance, if modifying will cause problems with you application not being compatible anymore with legacy clients, you should not ! Subclass instead in this case.
part of the assignment will be to enhance the Data class. You may do this by modification or subclassing, but you must document the approach and reason for your choice
There's nothing wrong with fixing the deprecated methods and adding 'criteriaFind' to the 'Data' class even if it is in use elsewhere. The class will still perform the same.
part of the assignment will be to enhance the Data class. You may do this by modification or subclassing, but you must document the approach and reason for your choice
part ofthe assignment will be to enhance the Data class. You may do this by modification or subclassing, but you must document the approach and reason for your choice