org.apache.poi
Class POIXMLDocument
- java.lang.Object
-
- org.apache.poi.POIXMLDocumentPart
-
- org.apache.poi.POIXMLDocument
-
- Direct Known Subclasses:
- XMLSlideShow, XSLFSlideShow, XSSFWorkbook, XWPFDocument
public abstract class POIXMLDocument extends POIXMLDocumentPart
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringDOCUMENT_CREATORstatic java.lang.StringOLE_OBJECT_REL_TYPEstatic java.lang.StringPACK_OBJECT_REL_TYPE-
Fields inherited from class org.apache.poi.POIXMLDocumentPart
DEFAULT_XML_OPTIONS
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract java.util.List<PackagePart>getAllEmbedds()Get the document's embedded files.OPCPackagegetPackage()POIXMLPropertiesgetProperties()Get the document properties.static booleanhasOOXMLHeader(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.static OPCPackageopenPackage(java.lang.String path)Wrapper to open a package, returning an IOException in the event of a problem.voidwrite(java.io.OutputStream stream)Write out this document to an Outputstream.-
Methods inherited from class org.apache.poi.POIXMLDocumentPart
addRelation, createRelationship, createRelationship, getPackagePart, getPackageRelationship, getParent, getRelationById, getRelationId, getRelations, toString
-
-
-
-
Field Detail
-
DOCUMENT_CREATOR
public static final java.lang.String DOCUMENT_CREATOR
- See Also:
- Constant Field Values
-
OLE_OBJECT_REL_TYPE
public static final java.lang.String OLE_OBJECT_REL_TYPE
- See Also:
- Constant Field Values
-
PACK_OBJECT_REL_TYPE
public static final java.lang.String PACK_OBJECT_REL_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
openPackage
public static OPCPackage openPackage(java.lang.String path) throws java.io.IOException
Wrapper to open a package, returning an IOException in the event of a problem. Works around shortcomings in java's this() constructor calls- Throws:
java.io.IOException
-
getPackage
public OPCPackage getPackage()
-
hasOOXMLHeader
public static boolean hasOOXMLHeader(java.io.InputStream inp) throws java.io.IOExceptionChecks that the supplied InputStream (which MUST support mark and reset, or be a PushbackInputStream) has a OOXML (zip) header at the start of it. If your InputStream does not support mark / reset, then wrap it in a PushBackInputStream, then be sure to always use that, and not the original!- Parameters:
inp- An InputStream which supports either mark/reset, or is a PushbackInputStream- Throws:
java.io.IOException
-
getProperties
public POIXMLProperties getProperties()
Get the document properties. This gives you access to the core ooxml properties, and the extended ooxml properties.
-
getAllEmbedds
public abstract java.util.List<PackagePart> getAllEmbedds() throws OpenXML4JException
Get the document's embedded files.- Throws:
OpenXML4JException
-
write
public final void write(java.io.OutputStream stream) throws java.io.IOExceptionWrite out this document to an Outputstream.- Parameters:
stream- - the java OutputStream you wish to write the file to- Throws:
java.io.IOException- if anything can't be written.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG