gpt4 book ai didi

org.apache.poi.openxml4j.opc.internal.ZipHelper.getOPCNameFromZipItemName()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 01:11:31 27 4
gpt4 key购买 nike

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

ZipHelper.getOPCNameFromZipItemName介绍

[英]Convert a zip name into an OPC name by adding a leading forward slash to the specified item name.
[中]通过向指定的项目名称添加前导正斜杠,将zip名称转换为OPC名称。

代码示例

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

EntryTriple(final ZipArchiveEntry zipArchiveEntry, final ContentTypeManager contentTypeManager) {
  this.zipArchiveEntry = zipArchiveEntry;
  final String entryName = zipArchiveEntry.getName();
  PackagePartName ppn = null;
  try {
    // We get an error when we parse [Content_Types].xml
    // because it's not a valid URI.
    ppn = (CONTENT_TYPES_PART_NAME.equalsIgnoreCase(entryName)) ? null
      : PackagingURIHelper.createPartName(ZipHelper.getOPCNameFromZipItemName(entryName));
  } catch (Exception e) {
    // We assume we can continue, even in degraded mode ...
    LOG.log(POILogger.WARN,"Entry " + entryName + " is not valid, so this part won't be add to the package.", e);
  }
  this.partName = ppn;
  this.contentType = (ppn == null) ? null : contentTypeManager.getContentType(partName);
}

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

/**
 * Builds a PackagePartName for the given ZipEntry,
 *  or null if it's the content types / invalid part
 */
private PackagePartName buildPartName(ZipEntry entry) {
  try {
    // We get an error when we parse [Content_Types].xml
    // because it's not a valid URI.
    if (entry.getName().equalsIgnoreCase(
        ContentTypeManager.CONTENT_TYPES_PART_NAME)) {
      return null;
    }
    return PackagingURIHelper.createPartName(ZipHelper
        .getOPCNameFromZipItemName(entry.getName()));
  } catch (Exception e) {
    // We assume we can continue, even in degraded mode ...
    logger.log(POILogger.WARN,"Entry "
            + entry.getName()
            + " is not valid, so this part won't be add to the package.", e);
    return null;
  }
}

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

EntryTriple(final ZipArchiveEntry zipArchiveEntry, final ContentTypeManager contentTypeManager) {
  this.zipArchiveEntry = zipArchiveEntry;
  final String entryName = zipArchiveEntry.getName();
  PackagePartName ppn = null;
  try {
    // We get an error when we parse [Content_Types].xml
    // because it's not a valid URI.
    ppn = (CONTENT_TYPES_PART_NAME.equalsIgnoreCase(entryName)) ? null
      : PackagingURIHelper.createPartName(ZipHelper.getOPCNameFromZipItemName(entryName));
  } catch (Exception e) {
    // We assume we can continue, even in degraded mode ...
    LOG.log(POILogger.WARN,"Entry " + entryName + " is not valid, so this part won't be add to the package.", e);
  }
  this.partName = ppn;
  this.contentType = (ppn == null) ? null : contentTypeManager.getContentType(partName);
}

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