public abstract class POIXMLDocument extends POIXMLDocumentPart implements java.io.Closeable
POIXMLDocumentPart.RelationPart
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOCUMENT_CREATOR |
static java.lang.String |
OLE_OBJECT_REL_TYPE |
static java.lang.String |
PACK_OBJECT_REL_TYPE |
Modifier | Constructor and Description |
---|---|
protected |
POIXMLDocument(OPCPackage pkg) |
protected |
POIXMLDocument(OPCPackage pkg,
java.lang.String coreDocumentRel) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the underlying
OPCPackage from which this
document was read, if there is one |
abstract java.util.List<PackagePart> |
getAllEmbedds()
Get the document's embedded files.
|
protected PackagePart |
getCorePart() |
OPCPackage |
getPackage() |
POIXMLProperties |
getProperties()
Get the document properties.
|
protected PackagePart[] |
getRelatedByType(java.lang.String contentType)
Retrieves all the PackageParts which are defined as
relationships of the base document with the
specified content type.
|
static boolean |
hasOOXMLHeader(java.io.InputStream inp)
Checks that the supplied InputStream (which MUST
support mark and reset, or be a PushbackInputStream)
has a OOXML (zip) header at the start of it.
|
protected void |
load(POIXMLFactory factory) |
static OPCPackage |
openPackage(java.lang.String path)
Wrapper to open a package, returning an IOException
in the event of a problem.
|
void |
write(java.io.OutputStream stream)
Write out this document to an Outputstream.
|
_invokeOnDocumentRead, addRelation, addRelation, commit, createRelationship, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelationParts, getRelations, getTargetPart, onDocumentCreate, onDocumentRead, onDocumentRemove, onSave, prepareForCommit, read, rebase, removeRelation, removeRelation, toString
public static final java.lang.String DOCUMENT_CREATOR
public static final java.lang.String OLE_OBJECT_REL_TYPE
public static final java.lang.String PACK_OBJECT_REL_TYPE
protected POIXMLDocument(OPCPackage pkg)
protected POIXMLDocument(OPCPackage pkg, java.lang.String coreDocumentRel)
public static OPCPackage openPackage(java.lang.String path) throws java.io.IOException
java.io.IOException
public OPCPackage getPackage()
protected PackagePart getCorePart()
protected PackagePart[] getRelatedByType(java.lang.String contentType) throws InvalidFormatException
InvalidFormatException
public static boolean hasOOXMLHeader(java.io.InputStream inp) throws java.io.IOException
inp
- An InputStream which supports either mark/reset, or is a PushbackInputStreamjava.io.IOException
public POIXMLProperties getProperties()
public abstract java.util.List<PackagePart> getAllEmbedds() throws OpenXML4JException
OpenXML4JException
protected final void load(POIXMLFactory factory) throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
OPCPackage
from which this
document was read, if there is oneclose
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException
public final void write(java.io.OutputStream stream) throws java.io.IOException
File
rather
than an InputStream
, you must write out to
a different file, overwriting via an OutputStream isn't possible.stream
- - the java OutputStream you wish to write the file tojava.io.IOException
- if anything can't be written.Copyright 2017 The Apache Software Foundation or its licensors, as applicable.