private void list(ArrayList<MAPIProperty> list, PrintStream out) { for(MAPIProperty attr : list) { String id = Integer.toHexString(attr.id); while(id.length() < 4) { id = "0"+id; } int typeId = attr.usualType.getId(); String typeIdStr = Integer.toString(typeId); if (typeId > 0) { typeIdStr = typeIdStr + " / 0x" + Integer.toHexString(typeId); } out.println("0x" + id + " - " + attr.name); out.println(" " + attr.id + " - " + attr.usualType.getName() + " (" + typeIdStr + ") - " + attr.mapiProperty); } }
public MAPIStringAttribute(MAPIProperty property, int type, byte[] data) { super(property, type, data); String tmpData = null; if(type == Types.ASCII_STRING.getId()) { tmpData = new String(data, Charset.forName(CODEPAGE)); } else if(type == Types.UNICODE_STRING.getId()) { tmpData = StringUtil.getFromUnicodeLE(data); } else { throw new IllegalArgumentException("Not a string type " + type); } // Strip off the null terminator if present if(tmpData.endsWith("\0")) { tmpData = tmpData.substring(0, tmpData.length()-1); } this.data = tmpData; }
MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() ); Parser rtfParser =
ByteChunk chunk = (ByteChunk) rtfChunk; MAPIRtfAttribute rtf = new MAPIRtfAttribute( MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() ); RTFParser rtfParser = new RTFParser();
MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() ); Parser rtfParser =
MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() ); Parser rtfParser =
ByteChunk chunk = (ByteChunk) rtfChunk; MAPIRtfAttribute rtf = new MAPIRtfAttribute( MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() );
/** * Gets the RTF Rich Message body of this Outlook Message, if this email * contains a RTF (rich) version. * @return The string representation of the 'RTF' version of the body, if available. * @throws ChunkNotFoundException If the rtf-body chunk does not exist and * returnNullOnMissingChunk is set */ public String getRtfBody() throws ChunkNotFoundException { ByteChunk chunk = mainChunks.getRtfBodyChunk(); if(chunk == null) { if(returnNullOnMissingChunk) { return null; } else { throw new ChunkNotFoundException(); } } try { MAPIRtfAttribute rtf = new MAPIRtfAttribute( MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() ); return rtf.getDataString(); } catch(IOException e) { throw new RuntimeException("Shouldn't happen", e); } }
ByteChunk chunk = (ByteChunk) rtfChunk; MAPIRtfAttribute rtf = new MAPIRtfAttribute( MAPIProperty.RTF_COMPRESSED, Types.BINARY.getId(), chunk.getValue() );