Search in sources :

Example 1 with PropertiesChunk

use of org.apache.poi.hsmf.datatypes.PropertiesChunk in project poi by apache.

the class HSMFDump method dump.

public void dump(PrintStream out) throws IOException {
    ChunkGroup[] chunkGroups = POIFSChunkParser.parse(fs);
    for (ChunkGroup chunks : chunkGroups) {
        out.println(chunks.getClass().getSimpleName());
        for (Chunk chunk : chunks.getChunks()) {
            MAPIProperty attr = MAPIProperty.get(chunk.getChunkId());
            if (chunk instanceof PropertiesChunk) {
                PropertiesChunk props = (PropertiesChunk) chunk;
                out.println("   Properties - " + props.getProperties().size() + ":");
                for (MAPIProperty prop : props.getProperties().keySet()) {
                    out.println("       * " + prop);
                    for (PropertyValue v : props.getValues(prop)) {
                        out.println("        = " + v);
                    }
                }
            } else {
                String idName = attr.id + " - " + attr.name;
                if (attr == MAPIProperty.UNKNOWN) {
                    idName = chunk.getChunkId() + " - (unknown)";
                }
                out.println("   " + idName + " - " + chunk.getType().getName());
                out.println("       " + chunk);
            }
        }
        out.println();
    }
}
Also used : ChunkGroup(org.apache.poi.hsmf.datatypes.ChunkGroup) PropertiesChunk(org.apache.poi.hsmf.datatypes.PropertiesChunk) PropertyValue(org.apache.poi.hsmf.datatypes.PropertyValue) PropertiesChunk(org.apache.poi.hsmf.datatypes.PropertiesChunk) Chunk(org.apache.poi.hsmf.datatypes.Chunk) MAPIProperty(org.apache.poi.hsmf.datatypes.MAPIProperty)

Aggregations

Chunk (org.apache.poi.hsmf.datatypes.Chunk)1 ChunkGroup (org.apache.poi.hsmf.datatypes.ChunkGroup)1 MAPIProperty (org.apache.poi.hsmf.datatypes.MAPIProperty)1 PropertiesChunk (org.apache.poi.hsmf.datatypes.PropertiesChunk)1 PropertyValue (org.apache.poi.hsmf.datatypes.PropertyValue)1