com.groupdocs.parser.data

Class ContainerItem



  • public abstract class ContainerItem
    extends Object
    Represents a container item like Zip archive entity, email attachment, PDF Portfolio item and so on.

    An instance of ContainerItem class is used as return value of Parser.getContainer() method. See the usage examples there.

    • Constructor Detail

      • ContainerItem

        public ContainerItem(String name,
                     String directory,
                     long size,
                     Iterable<MetadataItem> metadata)
        Initializes a new instance of ContainerItem with the item name and directory.
        Parameters:
        name - The name of the item.
        directory - The directory of the item.
        size - The size of the item.
        metadata - The collection of metadata items.
      • ContainerItem

        public ContainerItem(String filePath,
                     long size,
                     Iterable<MetadataItem> metadata)
        Initializes a new instance of ContainerItem with the item full path.
        Parameters:
        filePath - The full path of the item.
        size - The size of the item.
        metadata - The collection of metadata items.
    • Method Detail

      • getName

        public String getName()
        Gets the name of the item.
        Returns:
        A string value that represents the file name of the item (without a directory).
      • getDirectory

        public String getDirectory()
        Gets the directory of the item.
        Returns:
        A string value that represents the directory of the item (without a file name).
      • getFilePath

        public String getFilePath()
        Gets the full path of the item.
        Returns:
        A string value that represents the full path of the item.
      • getSize

        public long getSize()
        Gets the size of the item.
        Returns:
        An integer value that represents the size of the item in bytes.
      • getMetadata

        public Iterable<MetadataItem> getMetadata()
        Gets the collection of metadata items.
        Returns:
        A collection of MetadataItem objects; empty if metadata isn't set.
      • openStream

        public abstract InputStream openStream()
        Opens the stream of the item content.
        Returns:
        A stream with the item content.
      • openParser

        public Parser openParser()
        Creates the Parser object for the item content.
        Returns:
        An instance of Parser class of the item content.
      • openParser

        public Parser openParser(LoadOptions loadOptions)
        Creates the Parser object for the item content with LoadOptions.
        Parameters:
        loadOptions - The options to open the item content.
        Returns:
        An instance of Parser class of the item content.
      • openParser

        public abstract Parser openParser(LoadOptions loadOptions,
                        ParserSettings parserSettings)
        Creates the Parser object for the item content with LoadOptions and ParserSettings.
        Parameters:
        loadOptions - The options to open the item content.
        parserSettings - The parser settings which are used to customize data extraction.
        Returns:
        An instance of Parser class of the item content.