/**
*
* @return Vector mit den Files (werden ins Temp-Verzeichnis geschrieben) PNG-Dateien werden NICHT berücksichtigt
*/
public Vector<File> anhaenge_Aus_msg_Datei_Extrahieren(File f_msg)
{
Vector<File> vec_files = new Vector<File>();
try
{
MAPIMessage mapimsg = new MAPIMessage(f_msg.getAbsolutePath());
//Nachricht selbst
String addressaten = mapimsg.getRecipientEmailAddress();
String subject = mapimsg.getSubject();
String text = mapimsg.getTextBody();
AttachmentChunks attachments[] = mapimsg.getAttachmentFiles();
if(attachments.length > 0) {
for (AttachmentChunks a : attachments) {
// extract attachment
ByteArrayInputStream fileIn = new ByteArrayInputStream(a.getAttachData().getValue());
File f = new File(User_Utils.tempverzeichnis, a.getAttachLongFileName().toString()); // output
if (!FilenameUtils.getExtension(f.getName()).toUpperCase().equals("PNG"))
{
vec_files.add(f);
OutputStream fileOut = null;
try {
fileOut = new FileOutputStream(f);
byte[] buffer = new byte[2048];
int bNum = fileIn.read(buffer);
while(bNum > 0) {
fileOut.write(buffer);
bNum = fileIn.read(buffer);
}
}
finally {
try {
if(fileIn != null) {
fileIn.close();
}
}
finally {
if(fileOut != null) {
fileOut.close();
}
}
}
}
}
}
}
catch (Exception ex)
{
}
return vec_files;
}