I am working on project and in which I make a program to create a file folder in system. When i run my program it shows:
java.io.FileNotFoundException:File 'E:\Program Files\IBM\SDP\Profin\EmailAttachment\30189\31609\T0000021811.pdf' does not exist
My code is:
public EmailQueueAttachment[] get(Long emailQueueId)throws InvalidDAOArgumentException {
if (emailQueueId == null) {
throw new InvalidDAOArgumentException("Email Queue Id can not be null.");
}
EmailQueueAttachmentListHelper criteria = new EmailQueueAttachmentListHelper();
criteria.setEmailQueueId(emailQueueId);
List<Model> emailQueueAttachmentList = getList(criteria, -1, -1).getCurrentPageData();
if (emailQueueAttachmentList != null) {
EmailQueueAttachment[] attachments = (EmailQueueAttachment[]) emailQueueAttachmentList.toArray(new EmailQueueAttachment[emailQueueAttachmentList.size()]);
for(int i=0; i<attachments.length; i++){
try {
attachments[i].setAttachmentContent(FileUtils.readFileToByteArray(new File(SystemUtil.getEmailAttachmentFolderName() + File.separator + emailQueueId + File.separator + attachments[i].getRecNo() + File.separator + attachments[i].getAttachmentName())));
} catch (IOException e) {
e.printStackTrace();
throw new DAOException(e);
}
}
return attachments;
}
return null;
}