Package org.openpreservation.odf.pkg
Interface PackageParser
- All Known Subinterfaces:
ValidatingParser
public interface PackageParser
An interface defining the behaviour of ODF package parsers.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionparsePackage
(File toParse) Parse a Java File instance and return anOdfPackage
instance.parsePackage
(InputStream toParse, String name) Parse anInputStream
and return anOdfPackage
instance.parsePackage
(Path is) Resove and parse a systemPath
and return anOdfPackage
instance.
-
Method Details
-
parsePackage
Resove and parse a systemPath
and return anOdfPackage
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 packageZipArchive
.NullPointerException
- whentoParse
is nullPackageParser.ParseException
FileNotFoundException
-
parsePackage
Parse a Java File instance and return anOdfPackage
instance. The returned package may not be valid but is parsed leniently.- Parameters:
toParse
- a systemPath
to parse, this must not benull
- Returns:
- the parsed
ODFPackage
- Throws:
IOException
- when there is an issue reading entries from the packageZipArchive
NullPointerException
- whentoParse
is nullPackageParser.ParseException
FileNotFoundException
-
parsePackage
Parse anInputStream
and return anOdfPackage
instance. The returned package may not be valid but is parsed leniently.- Parameters:
toParse
- anInputStream
to parse, this must not benull
name
- an identifier of some kind for the package, this must not benull
- Returns:
- the parsed
ODFPackage
- Throws:
IOException
- when there is an issue reading entries from the packageZipArchive
NullPointerException
- whentoParse
orname
isnull
PackageParser.ParseException
-