OpcPackage — Aspose.Slides FOSS Java API Reference
Overview
OpcPackage minimal OPC (Open Packaging Conventions) package backed by a ZIP archive. Browse the properties and methods in the tables below to understand the complete public API surface of this type. All members listed here are part of the stable public API and may be used in production code targeting the FOSS edition.
Package: org.aspose.slides.foss.internal.opc
Properties
| Property | Type | Access | Description |
|---|---|---|---|
sourcePath | Optional<String> | Read | Gets or sets the sourcePath value. |
partNames | Set<String> | Read/Write | The part names value. |
Methods
| Method | Returns | Description |
|---|---|---|
close() | void | Close the package and release resources. |
createNew() | OpcPackage | Create a new empty OPC package. |
deletePart() | boolean | Delete a part from the package. |
getPart() | Optional<byte[]> | Get the content of a part by name. |
getSourcePath() | Optional<String> | Get the original file path if the package was loaded from a file. |
open() | OpcPackage | Open an OPC package from a binary input stream. |
setPart() | void | Set or update the content of a part with string content (encoded as UTF-8). |
load(InputStream in) | void | Loads a package from a ZIP input stream. |
save(OutputStream out) | void | Saves the package as a ZIP archive to the given output stream. |
hasPart(String uri) | boolean | Returns whether a part with the given URI exists. |
getPartBytes(String uri) | byte[] | Returns the raw bytes of the given part, or null if not found. |
setPartBytes(String uri, byte[] data) | void | Sets the raw bytes for the given part URI. |
removePart(String uri) | void | Removes a part by URI. |
getPartNames() | Set<String> | Returns all part URIs as an unmodifiable set. |
clear() | void | Clears all parts, releasing memory held by byte arrays. |
parseXml(String uri) | Document | Parses the given part as an XML document. |
serializeXml(String uri, Document doc) | void | Serializes the given XML document and stores it as a part. |
newDocument() | Document | Creates a new empty XML document. |