gpt4 book ai didi

org.apache.poi.openxml4j.opc.ZipPackage.getZipArchive()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 22:23:31 27 4
gpt4 key购买 nike

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

ZipPackage.getZipArchive介绍

[英]Get the zip archive
[中]获取压缩文件

代码示例

代码示例来源:origin: org.apache.poi/poi-ooxml

/**
 * Implementation of the getInputStream() which return the inputStream of
 * this part zip entry.
 *
 * @return Input stream of this part zip entry.
 */
@Override
protected InputStream getInputStreamImpl() throws IOException {
  // We use the getInputStream() method from java.util.zip.ZipFile
  // class which return an InputStream to this part zip entry.
  return ((ZipPackage) _container).getZipArchive()
      .getInputStream(zipEntry);
}

代码示例来源:origin: org.apache.poi/poi-ooxml

in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(context.getZipEntry());
} else if (context.getPackage() != null) {
      .getCorePropertiesZipEntry((ZipPackage) context
          .getPackage());
  in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(zipEntry);
} else

代码示例来源: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.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

/**
 * Implementation of the getInputStream() which return the inputStream of
 * this part zip entry.
 *
 * @return Input stream of this part zip entry.
 */
@Override
protected InputStream getInputStreamImpl() throws IOException {
  // We use the getInputStream() method from java.util.zip.ZipFile
  // class which return an InputStream to this part zip entry.
  return ((ZipPackage) _container).getZipArchive()
      .getInputStream(zipEntry);
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

/**
 * Implementation of the getInputStream() which return the inputStream of
 * this part zip entry.
 *
 * @return Input stream of this part zip entry.
 */
@Override
protected InputStream getInputStreamImpl() throws IOException {
  // We use the getInputStream() method from java.util.zip.ZipFile
  // class which return an InputStream to this part zip entry.
  return ((ZipPackage) _container).getZipArchive()
      .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: jbaliuka/x4j-analytic

protected void closeWorbook(XLSXWorkbook workbook) {
  if (workbook != null && workbook.getPackage() != null && ((ZipPackage)workbook.getPackage()).getZipArchive() != null ) {
    try{
      workbook.getPackage().revert();
    }catch(Exception e){
      if(log.isDebugEnabled()){
        log.debug(e.getMessage(), e);
      }
    }
  }
}

代码示例来源: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.openl.rules/org.openl.lib.poi.dev

try {
  this.contentTypeManager = new ZipContentTypeManager(
      getZipArchive().getInputStream(entry), this);
} catch (IOException e) {
  throw new InvalidFormatException(e.getMessage());

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(context.getZipEntry());
} else if (context.getPackage() != null) {
      .getCorePropertiesZipEntry((ZipPackage) context
          .getPackage());
  in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(zipEntry);
} else

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(context.getZipEntry());
} else if (context.getPackage() != null) {
      .getCorePropertiesZipEntry((ZipPackage) context
          .getPackage());
  in = ((ZipPackage) context.getPackage()).getZipArchive()
      .getInputStream(zipEntry);
} else

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