gpt4 book ai didi

org.apache.poi.openxml4j.util.ZipEntrySource.getEntries()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 06:07:31 28 4
gpt4 key购买 nike

本文整理了Java中org.apache.poi.openxml4j.util.ZipEntrySource.getEntries()方法的一些代码示例,展示了ZipEntrySource.getEntries()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipEntrySource.getEntries()方法的具体详情如下:
包路径:org.apache.poi.openxml4j.util.ZipEntrySource
类名称:ZipEntrySource
方法名:getEntries

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();

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com