本文整理了Java中org.apache.poi.openxml4j.util.ZipEntrySource.getEntries()
方法的一些代码示例,展示了ZipEntrySource.getEntries()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntrySource.getEntries()
方法的具体详情如下:
包路径:org.apache.poi.openxml4j.util.ZipEntrySource
类名称:ZipEntrySource
方法名:getEntries
[英]Returns an Enumeration of all the Entries
[中]返回所有项的枚举
代码示例来源:origin: org.apache.poi/poi-ooxml
"Formats like these (eg ODS, ODP) are not supported, try Apache ODFToolkit");
if (!zipArchive.getEntries().hasMoreElements()) {
throw new NotOfficeXmlFileException(
"No valid entries or contents found, this is not a valid OOXML " +
Collections.list(zipArchive.getEntries()).stream()
.map(zae -> new EntryTriple(zae, contentTypeManager))
.filter(mm -> mm.partName != null)
代码示例来源:origin: org.apache.poi/poi-ooxml
protected void injectData(ZipEntrySource zipEntrySource, OutputStream out) throws IOException {
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(out);
try {
Enumeration<? extends ZipArchiveEntry> en = zipEntrySource.getEntries();
while (en.hasMoreElements()) {
ZipArchiveEntry ze = en.nextElement();
代码示例来源:origin: apache/tika
private static InputStream getZipStream(String zipPath, ZipPackage zipPackage) throws IOException, TikaException {
String targPath = (zipPath.length() > 1 && zipPath.startsWith("/") ? zipPath.substring(1) : zipPath);
ZipEntrySource zipEntrySource = zipPackage.getZipArchive();
Enumeration<? extends ZipArchiveEntry> zipEntryEnumeration = zipEntrySource.getEntries();
ZipArchiveEntry zipEntry = null;
while (zipEntryEnumeration.hasMoreElements()) {
ZipArchiveEntry ze = zipEntryEnumeration.nextElement();
if (ze.getName().equals(targPath)) {
zipEntry = ze;
break;
}
}
if (zipEntry == null) {
throw new TikaException("Couldn't find required zip entry: " + zipPath);
}
return zipEntrySource.getInputStream(zipEntry);
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Retrieve the Zip entry of the content types part.
*/
public static ZipEntry getContentTypeZipEntry(ZipPackage pkg) {
Enumeration entries = pkg.getZipArchive().getEntries();
// Enumerate through the Zip entries until we find the one named
// '[Content_Types].xml'.
while (entries.hasMoreElements()) {
ZipEntry entry = (ZipEntry) entries.nextElement();
if (entry.getName().equals(
ContentTypeManager.CONTENT_TYPES_PART_NAME))
return entry;
}
return null;
}
代码示例来源:origin: org.apache.tika/tika-parsers
private static InputStream getZipStream(String zipPath, ZipPackage zipPackage) throws IOException, TikaException {
String targPath = (zipPath.length() > 1 && zipPath.startsWith("/") ? zipPath.substring(1) : zipPath);
ZipEntrySource zipEntrySource = zipPackage.getZipArchive();
Enumeration<? extends ZipArchiveEntry> zipEntryEnumeration = zipEntrySource.getEntries();
ZipArchiveEntry zipEntry = null;
while (zipEntryEnumeration.hasMoreElements()) {
ZipArchiveEntry ze = zipEntryEnumeration.nextElement();
if (ze.getName().equals(targPath)) {
zipEntry = ze;
break;
}
}
if (zipEntry == null) {
throw new TikaException("Couldn't find required zip entry: " + zipPath);
}
return zipEntrySource.getInputStream(zipEntry);
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
"Formats like these (eg ODS, ODP) are not supported, try Apache ODFToolkit");
if (!zipArchive.getEntries().hasMoreElements()) {
throw new NotOfficeXmlFileException(
"No valid entries or contents found, this is not a valid OOXML " +
Collections.list(zipArchive.getEntries()).stream()
.map(zae -> new EntryTriple(zae, contentTypeManager))
.filter(mm -> mm.partName != null)
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
Enumeration<? extends ZipEntry> entries = this.zipArchive.getEntries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
entries = this.zipArchive.getEntries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
entries = this.zipArchive.getEntries();
while (entries.hasMoreElements()) {
ZipEntry entry = entries.nextElement();
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
protected void injectData(ZipEntrySource zipEntrySource, OutputStream out) throws IOException {
ZipArchiveOutputStream zos = new ZipArchiveOutputStream(out);
try {
Enumeration<? extends ZipArchiveEntry> en = zipEntrySource.getEntries();
while (en.hasMoreElements()) {
ZipArchiveEntry ze = en.nextElement();
内容来源于网络,如有侵权,请联系作者删除!