Interface PackageParser

All Known Subinterfaces:
ValidatingParser

public interface PackageParser
An interface defining the behaviour of ODF package parsers.
  • Method Details

    • parsePackage

      OdfPackage parsePackage(Path is) throws IOException
      Resove and parse a system Path and return an OdfPackage instance. The returned package may not be valid but is parsed leniently.
      Parameters:
      is - a system path to parse, this must not be null
      Returns:
      the parsed ODFPackage
      Throws:
      IOException - when there is an issue reading entries from the package ZipArchive.
      NullPointerException - when toParse is null
    • parsePackage

      OdfPackage parsePackage(File toParse) throws IOException
      Parse a Java File instance and return an OdfPackage instance. The returned package may not be valid but is parsed leniently.
      Parameters:
      toParse - a system Path to parse, this must not be null
      Returns:
      the parsed ODFPackage
      Throws:
      IOException - when there is an issue reading entries from the package ZipArchive
      NullPointerException - when toParse is null
    • parsePackage

      OdfPackage parsePackage(InputStream toParse, String name) throws IOException
      Parse an InputStream and return an OdfPackage instance. The returned package may not be valid but is parsed leniently.
      Parameters:
      toParse - an InputStream to parse, this must not be null
      name - an identifier of some kind for the package, this must not be null
      Returns:
      the parsed ODFPackage
      Throws:
      IOException - when there is an issue reading entries from the package ZipArchive
      NullPointerException - when toParse or name is null