public class ZipPackagePart extends PackagePart
PackagePart
_container, _contentType, _partName
Constructor and Description |
---|
ZipPackagePart(OPCPackage container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipEntry, PackagePartName partName, java.lang.String contentType)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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()
Implementation of the getInputStream() which return the inputStream of this part zip entry.
(getInputStream() 的实现,它返回这部分 zip 条目的 inputStream。)
|
protected java.io.OutputStream |
getOutputStreamImpl()
Implementation of the getOutputStream().
(getOutputStream() 的实现。)
|
long |
getSize() |
org.apache.commons.compress.archivers.zip.ZipArchiveEntry |
getZipArchive()
Get the zip entry of this part.
(获取此部分的 zip 条目。)
|
boolean |
load(java.io.InputStream ios)
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, clear, clearRelationships, compareTo, findExistingRelation, getContentType, getContentTypeDetails, getInputStream, getOutputStream, getPackage, getPartName, getRelatedPart, getRelationship, getRelationships, getRelationshipsByType, hasRelationships, isDeleted, isRelationshipExists, isRelationshipPart, removeRelationship, setContentType, setDeleted, toString
public ZipPackagePart(OPCPackage container, org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipEntry, PackagePartName partName, java.lang.String contentType) throws InvalidFormatException
container
- The container package.
(container - 容器包。)
zipEntry
- The zip entry corresponding to this part.
(zipEntry - 此部分对应的 zip 条目。)
partName
- The part name.
(partName - 部分名称。)
contentType
- Content type.
(contentType - 内容类型。)
InvalidFormatException
- Throws if the content of this part is invalid.
(InvalidFormatException - 如果此部分的内容无效,则抛出。)
public org.apache.commons.compress.archivers.zip.ZipArchiveEntry getZipArchive()
protected java.io.InputStream getInputStreamImpl() throws java.io.IOException
getInputStreamImpl
in class
PackagePart
(类 PackagePart 中的 getInputStreamImpl)
java.io.IOException
- Throws if an IO Exception occur in the implementation method.
(java.io.IOException - 如果在实现方法中发生 IO 异常,则抛出。)
protected java.io.OutputStream getOutputStreamImpl()
getOutputStreamImpl
in class
PackagePart
(类 PackagePart 中的 getOutputStreamImpl)
public long getSize()
getSize
in class
PackagePart
public boolean save(java.io.OutputStream os) throws OpenXML4JException
PackagePart
save
in class
PackagePart
(保存在 PackagePart 类中)
os
- Output stream to save this part.
(os - 输出流以保存这部分。)
POILogger
(如果内容已成功存储,则为 true,否则为 false。有关错误的更多信息可以通过 POILogger 记录)
OpenXML4JException
- If any exception occur.
(OpenXML4JException - 如果发生任何异常。)
@NotImplemented public boolean load(java.io.InputStream ios)
PackagePart
load
in class
PackagePart
(在类 PackagePart 中加载)
ios
- The input stream of the content to load.
(ios - 要加载的内容的输入流。)
POILogger
(如果内容已成功加载,则为 true,否则为 false。有关错误的更多信息可以通过 POILogger 记录)
@NotImplemented public void close()
PackagePart
close
in class
PackagePart
(在类 PackagePart 中关闭)
@NotImplemented public void flush()
PackagePart
flush
in class
PackagePart
(在类 PackagePart 中刷新)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.