@Beta public final class TempFilePackagePart extends PackagePart
_container, _contentType, _partName
Constructor and Description |
---|
TempFilePackagePart(OPCPackage pack,
PackagePartName partName,
java.lang.String contentType)
Constructor.
|
TempFilePackagePart(OPCPackage pack,
PackagePartName partName,
java.lang.String contentType,
boolean loadRelationships)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Allows sub-classes to clean up before new data is added.
|
void |
close()
Close this part : flush this part, close the input stream and output
stream.
|
void |
flush()
Flush the content of this part.
|
protected java.io.InputStream |
getInputStreamImpl()
Method that gets the input stream for this part.
|
protected java.io.OutputStream |
getOutputStreamImpl()
Method that gets the output stream for this part.
|
long |
getSize() |
boolean |
load(java.io.InputStream is)
Load the content of this part.
|
boolean |
save(java.io.OutputStream os)
Save the content of this part and the associated relationships part (if
this part own at least one relationship) into the specified output
stream.
|
addExternalRelationship, addExternalRelationship, addRelationship, addRelationship, addRelationship, addRelationship, clearRelationships, compareTo, findExistingRelation, getContentType, getContentTypeDetails, getInputStream, getOutputStream, getPackage, getPartName, getRelatedPart, getRelationship, getRelationships, getRelationshipsByType, hasRelationships, isDeleted, isRelationshipExists, isRelationshipPart, removeRelationship, setContentType, setDeleted, toString
public TempFilePackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType) throws InvalidFormatException, java.io.IOException
pack
- The owner package.partName
- The part name.contentType
- The content type.InvalidFormatException
- If the specified URI is not OPC compliant.java.io.IOException
- If temp file cannot be created.public TempFilePackagePart(OPCPackage pack, PackagePartName partName, java.lang.String contentType, boolean loadRelationships) throws InvalidFormatException, java.io.IOException
pack
- The owner package.partName
- The part name.contentType
- The content type.loadRelationships
- Specify if the relationships will be loaded.InvalidFormatException
- If the specified URI is not OPC compliant.java.io.IOException
- If temp file cannot be created.protected java.io.InputStream getInputStreamImpl() throws java.io.IOException
PackagePart
getInputStreamImpl
in class PackagePart
java.io.IOException
- Throws if an IO Exception occur in the implementation method.protected java.io.OutputStream getOutputStreamImpl() throws java.io.IOException
PackagePart
getOutputStreamImpl
in class PackagePart
java.io.IOException
- Throws if an IO Exception occur in the implementation method.public long getSize()
getSize
in class PackagePart
public void clear()
PackagePart
clear
in class PackagePart
public boolean save(java.io.OutputStream os) throws OpenXML4JException
PackagePart
save
in class PackagePart
os
- Output stream to save this part.OpenXML4JException
- If any exception occur.public boolean load(java.io.InputStream is) throws InvalidFormatException
PackagePart
load
in class PackagePart
is
- The input stream of the content to load.InvalidFormatException
- Throws if the content format is invalid.public void close()
PackagePart
close
in class PackagePart
public void flush()
PackagePart
flush
in class PackagePart
Copyright 2022 The Apache Software Foundation or its licensors, as applicable.