public void listByName(PrintStream out) { ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll()); all.sort(new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { return a.name.compareTo(b.name); } }); list(all, out); } public void listById(PrintStream out) {
private MAPIProperty(int id, int usualType, String name, String mapiProperty) { this.id = id; this.usualType = usualType; this.name = name; this.mapiProperty = mapiProperty; // If it isn't unknown or custom, store it for lookup if(id == -1 || (id >= ID_FIRST_CUSTOM && id <= ID_LAST_CUSTOM) || (this instanceof CustomMAPIProperty)) { // Custom/Unknown, skip } else { if(attributes.containsKey(id)) { throw new IllegalArgumentException( "Duplicate MAPI Property with ID " + id + " : " + toString() + " vs " + attributes.get(id).toString() ); } attributes.put(id, this); } } public String toString() {
MAPIProperty prop = MAPIProperty.get(id); if(id >= 0x8000 && id <= 0xFFFF) { byte[] guid = new byte[16]; MAPIProperty base = MAPIProperty.get(mpid); name = base.name; } else { prop = MAPIProperty.createCustom(id, type, name); prop = MAPIProperty.createCustom(id, type, "(unknown " + Integer.toHexString(id) + ")");
public void record(Chunk chunk) { MAPIProperty prop = MAPIProperty.get(chunk.getChunkId());
protected MAPIAttribute getBodyAttribute() { MAPIAttribute body = message.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED); if (body != null) return body; // See bug #59786 - we'd really like a test file to confirm if this // is the right properties + if this is truely general or not! MAPIProperty uncompressedBody = MAPIProperty.createCustom(0x3fd9, Types.ASCII_STRING, "Uncompressed Body"); // Return this uncompressed one, or null if that isn't their either return message.getMessageMAPIAttribute(uncompressedBody); }
MAPIProperty prop = MAPIProperty.get(id); if(id >= 0x8000 && id <= 0xFFFF) { byte[] guid = new byte[16]; MAPIProperty base = MAPIProperty.get(mpid); name = base.name; } else { prop = MAPIProperty.createCustom(id, type, name); prop = MAPIProperty.createCustom(id, type, "(unknown " + Integer.toHexString(id) + ")");
public void dump() throws IOException { ChunkGroup[] chunkGroups = POIFSChunkParser.parse(fs); for(ChunkGroup chunks : chunkGroups) { System.out.println(chunks.getClass().getSimpleName()); for(Chunk chunk : chunks.getChunks()) { MAPIProperty attr = MAPIProperty.get(chunk.getChunkId()); String idName = attr.id + " - " + attr.name; if(attr == MAPIProperty.UNKNOWN) { idName = chunk.getChunkId() + " - (unknown)"; } System.out.println( " " + idName + " - " + Types.asName(chunk.getType()) ); System.out.println( " " + chunk.toString() ); } System.out.println(); } }
MAPIProperty prop = MAPIProperty.get(id); prop = MAPIProperty.createCustom(id, type, "Unknown " + id);
public String toString() { return getProperty().toString() + " " + data; } }
public void listById(PrintStream out) { ArrayList<MAPIProperty> all = new ArrayList<>(MAPIProperty.getAll()); all.sort(new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { return Integer.compare(a.id, b.id); } }); list(all, out); } private void list(ArrayList<MAPIProperty> list, PrintStream out) {
out.println(chunks.getClass().getSimpleName()); for(Chunk chunk : chunks.getChunks()) { MAPIProperty attr = MAPIProperty.get(chunk.getChunkId());
private MAPIProperty(int id, MAPIType usualType, String name, String mapiProperty) { this.id = id; this.usualType = usualType; this.name = name; this.mapiProperty = mapiProperty; // If it isn't unknown or custom, store it for lookup if (id == -1 || (id >= ID_FIRST_CUSTOM && id <= ID_LAST_CUSTOM) || (this instanceof CustomMAPIProperty)) { // Custom/Unknown, skip } else { if (attributes.containsKey(id)) { throw new IllegalArgumentException( "Duplicate MAPI Property with ID " + id + " : " + toString() + " vs " + attributes.get(id)); } attributes.put(id, this); } }
public void listByName(PrintStream out) { ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll()); Collections.sort(all, new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { return a.name.compareTo(b.name); } }); list(all, out); } public void listById(PrintStream out) {
public String toString() { return getProperty().toString() + " " + data; }
public void listById(PrintStream out) { ArrayList<MAPIProperty> all = new ArrayList<MAPIProperty>(MAPIProperty.getAll()); Collections.sort(all, new Comparator<MAPIProperty>() { public int compare(MAPIProperty a, MAPIProperty b) { if(a.id < b.id) return -1; if(a.id > b.id) return +1; return 0; } }); list(all, out); } private void list(ArrayList<MAPIProperty> list, PrintStream out) {
public String toString() { return getProperty().toString() + " " + data.toString(); }
public String toString() { String hex; if(data.length <= 16) { hex = HexDump.toHex(data); } else { byte[] d = new byte[16]; System.arraycopy(data, 0, d, 0, 16); hex = HexDump.toHex(d); hex = hex.substring(0, hex.length()-1) + ", ....]"; } return property.toString() + " " + hex; }