if (!oRSet.wasNull()) iLen = Integer.parseInt(oLenPart.toString()); else iLen = -1;
oOffset = oRSet.getObject(6);
if (!oRSet.wasNull()) lOff = Long.parseLong(oOffset.toString()); else lOff = -1;
if (lPos!=-1) {
if (iLen==-1) throw new MessagingException("Part " + String.valueOf(iPartId) + " length not set at k_mime_parts table for message "+getMessage().getMessageGuid());
if (lOff==-1 ) throw new MessagingException("Part " + String.valueOf(iPartId) + " offset not set at k_mime_parts table for message "+getMessage().getMessageGuid());
if (DebugFile.trace) DebugFile.writeln("new MboxFile("+((DBFolder)getMessage().getFolder()).getFile()+")");
MboxFile oMbox = new MboxFile(((DBFolder)getMessage().getFolder()).getFile(), MboxFile.READ_ONLY);
InputStream oInStrm = oMbox.getPartAsStream(lPos, lOff, iLen);
oMimeBody = new MimeBodyPart(oInStrm);
oInStrm.close();
oMbox.close();
}
else {
if (DebugFile.trace) DebugFile.decIdent();
throw new MessagingException("Part " + String.valueOf(iPartId) + " not found for message " + getMessage().getContentID());
}
} // fi (MODE_MBOX)
} else {
if (DebugFile.trace) {
if (null==oFldr)
DebugFile.writeln("Part "+String.valueOf(iPartId) + " not found in message ["+getMessage().getMessageGuid()+"] " + getMessage().getContentID());
else
DebugFile.writeln("Part "+String.valueOf(iPartId) + " not found in message ["+getMessage().getMessageGuid()+"] " + getMessage().getContentID() + " at folder " + oFldr.getCategoryGuid());
}
} // fi (oRset.next();
oRSet.close();
oRSet = null;
oStmt.close();
oStmt = null;
} catch (SQLException sqle) {
try { if (null!=oRSet) oRSet.close(); } catch (Exception ignore) {}
try { if (null!=oStmt) oStmt.close(); } catch (Exception ignore) {}
throw new MessagingException(sqle.getMessage(), sqle);
} catch (com.enterprisedt.net.ftp.FTPException xcpt) {
try { if (null!=oRSet) oRSet.close(); } catch (Exception ignore) {}
try { if (null!=oStmt) oStmt.close(); } catch (Exception ignore) {}
throw new MessagingException(xcpt.getMessage(), xcpt);
}
if (oMimeBody!=null) {
if (DebugFile.trace) DebugFile.writeln("MimeBodyPart.getContent()");
oRetVal = oMimeBody.getContent();