org.apache.poi.hsmf.datatypes

## Class AttachmentChunks

- java.lang.Object
- - org.apache.poi.hsmf.datatypes.AttachmentChunks

- All Implemented Interfaces:
    ChunkGroup

      public class AttachmentChunks
      extends java.lang.Object
      implements ChunkGroup

  Collection of convenience chunks for standard parts of the MSG file attachment.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `AttachmentChunks.AttachmentChunksSorter` Orders by the attachment number.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `ByteChunk` | `attachRenderingWMF` This is in WMF Format.
    `static java.lang.String` | `PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AttachmentChunks(java.lang.String poifsName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `chunksComplete()` Used to flag that all the chunks of the attachment have now been located.
    `Chunk[]` | `getAll()`
    `StringChunk` | `getAttachContentId()`
    `ByteChunk` | `getAttachData()`
    `StringChunk` | `getAttachExtension()`
    `StringChunk` | `getAttachFileName()`
    `StringChunk` | `getAttachLongFileName()`
    `DirectoryChunk` | `getAttachmentDirectory()`
    `StringChunk` | `getAttachMimeTag()`
    `ByteChunk` | `getAttachRenderingWMF()`
    `Chunk[]` | `getChunks()` Returns the chunks that make up the group.
    `byte[]` | `getEmbeddedAttachmentObject()` Returns the embedded object, if the attachment is an object based embedding (image, document etc), or null if it's an embedded message
    `MAPIMessage` | `getEmbeddedMessage()` Returns the embedded MAPI message, if the attachment is an embedded message, or null otherwise
    `java.lang.String` | `getPOIFSName()`
    `boolean` | `isEmbeddedMessage()` Is this Attachment an embedded MAPI message?
    `void` | `record(Chunk chunk)` Called by the parser whenever a chunk is found.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PREFIX

          public static final java.lang.String PREFIX

      See Also:
        Constant Field Values

    - #### attachRenderingWMF

          public ByteChunk attachRenderingWMF

      This is in WMF Format. You'll probably want to pass it to Apache Batik to turn it into a SVG that you can then display.

  - ### Constructor Detail

    - #### AttachmentChunks

          public AttachmentChunks(java.lang.String poifsName)

  - ### Method Detail

    - #### isEmbeddedMessage

          public boolean isEmbeddedMessage()

      Is this Attachment an embedded MAPI message?

    - #### getEmbeddedMessage

          public MAPIMessage getEmbeddedMessage()
                                         throws java.io.IOException

      Returns the embedded MAPI message, if the attachment is an embedded message, or null otherwise
      Throws:
        `java.io.IOException`

    - #### getEmbeddedAttachmentObject

          public byte[] getEmbeddedAttachmentObject()

      Returns the embedded object, if the attachment is an object based embedding (image, document etc), or null if it's an embedded message

    - #### getAll

          public Chunk[] getAll()

    - #### getChunks

          public Chunk[] getChunks()

      Description copied from interface: `ChunkGroup`
      Returns the chunks that make up the group. Should certainly contain all the interesting Chunks, but needn't always contain all of the Chunks.
      Specified by:
        `getChunks` in interface `ChunkGroup`

    - #### getPOIFSName

          public java.lang.String getPOIFSName()

    - #### getAttachData

          public ByteChunk getAttachData()

      Returns:
        the ATTACH_DATA chunk

    - #### getAttachExtension

          public StringChunk getAttachExtension()

      Returns:
        the attachment extension

    - #### getAttachFileName

          public StringChunk getAttachFileName()

      Returns:
        the attachment (short) filename

    - #### getAttachLongFileName

          public StringChunk getAttachLongFileName()

      Returns:
        the attachment (long) filename

    - #### getAttachMimeTag

          public StringChunk getAttachMimeTag()

      Returns:
        the attachment mimetag

    - #### getAttachmentDirectory

          public DirectoryChunk getAttachmentDirectory()

      Returns:
        the attachment directory

    - #### getAttachRenderingWMF

          public ByteChunk getAttachRenderingWMF()

      Returns:
        the attachment preview bytes

    - #### getAttachContentId

          public StringChunk getAttachContentId()

      Returns:
        the attachment content ID

    - #### record

          public void record(Chunk chunk)

      Called by the parser whenever a chunk is found.
      Specified by:
        `record` in interface `ChunkGroup`

    - #### chunksComplete

          public void chunksComplete()

      Used to flag that all the chunks of the attachment have now been located.
      Specified by:
        `chunksComplete` in interface `ChunkGroup`

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.