gpt4 book ai didi

org.apache.poi.openxml4j.opc.internal.ZipContentTypeManager类的使用及代码示例

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

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

ZipContentTypeManager介绍

[英]Zip implementation of the ContentTypeManager.
[中]ContentTypeManager的Zip实现。

代码示例

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

/**
 * Constructor. Creates a new, empty ZipPackage.
 */
public ZipPackage() {
  super(defaultPackageAccess);
  this.zipArchive = null;
  try {
    this.contentTypeManager = new ZipContentTypeManager(null, this);
  } catch (InvalidFormatException e) {
    LOG.log(POILogger.WARN,"Could not parse ZipPackage", e);
  }
}

代码示例来源:origin: jbaliuka/x4j-analytic

ZipContentTypeManager manager = new ZipContentTypeManager(null,null);
  manager.addContentType(next.getPartName(), next.getContentType());
manager.save(out);

代码示例来源:origin: jbaliuka/x4j-analytic

public void processSheets(	ReportContext reportContext, List<String> savedParts, ZipContentTypeManager manager	)
    throws  Exception {
  for(int i = 0; i < workBook.getNumberOfSheets(); i++){
    XLSXSheet sheet = (XLSXSheet) nextSheet(reportContext, savedParts, i);
    CommentsTable comments = sheet.getCommentsTable(false);
    if(comments != null){
      String entryName = ZipHelper.getZipItemNameFromOPCName(comments.getPackagePart().getPartName().getName());
      savedParts.add(entryName);
      out.putNextEntry(new ZipEntry(entryName));
      comments.writeTo(out);
      out.closeEntry();
    }
    if (sheet.getPackagePart().hasRelationships()) {
      PackagePartName relationshipPartName = PackagingURIHelper
          .getRelationshipPartName(sheet.getPackagePart().getPartName());
      ZipPartMarshaller.marshallRelationshipPart(sheet.getPackagePart().getRelationships(),
          relationshipPartName, out);
      savedParts.add(relationshipPartName.getName());
      for (PackageRelationship next : sheet.getPackagePart().getRelationships()) {
        PackagePartName name = PackagingURIHelper.createPartName(next.getTargetURI());
        XSSFRelation type = XSSFRelation.getInstance(next.getRelationshipType());
        if (type != null) {
          manager.addContentType(name, type.getContentType());
        }
      }
    }
  }
}

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

private static void configurePackage(OPCPackage pkg) {
  try {
    // Content type manager
    pkg.contentTypeManager = new ZipContentTypeManager(null, pkg);
    
    // Add default content types for .xml and .rels
    pkg.contentTypeManager.addContentType(
        PackagingURIHelper.createPartName(
            PackagingURIHelper.PACKAGE_RELATIONSHIPS_ROOT_URI),
        ContentTypes.RELATIONSHIPS_PART);
    pkg.contentTypeManager.addContentType(
        PackagingURIHelper.createPartName("/default.xml"),
        ContentTypes.PLAIN_OLD_XML);
    // Initialise some PackageBase properties
    pkg.packageProperties = new PackagePropertiesPart(pkg,
        PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    pkg.packageProperties.setCreatorProperty("Generated by Apache POI OpenXML4J");
    pkg.packageProperties.setCreatedProperty(Optional.of(new Date()));
  } catch (InvalidFormatException e) {
    // Should never happen
    throw new IllegalStateException(e);
  }
}

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

this.contentTypeManager = new ZipContentTypeManager(
      zipArchive.getInputStream(contentTypeEntry), this);
} catch (IOException e) {

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

/**
 * Constructor. Creates a new, empty ZipPackage.
 */
public ZipPackage() {
  super(defaultPackageAccess);
  this.zipArchive = null;
  try {
    this.contentTypeManager = new ZipContentTypeManager(null, this);
  } catch (InvalidFormatException e) {
    LOG.log(POILogger.WARN,"Could not parse ZipPackage", e);
  }
}

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

private static void configurePackage(OPCPackage pkg) {
  try {
    // Content type manager
    pkg.contentTypeManager = new ZipContentTypeManager(null, pkg);
    
    // Add default content types for .xml and .rels
    pkg.contentTypeManager.addContentType(
        PackagingURIHelper.createPartName(
            PackagingURIHelper.PACKAGE_RELATIONSHIPS_ROOT_URI),
        ContentTypes.RELATIONSHIPS_PART);
    pkg.contentTypeManager.addContentType(
        PackagingURIHelper.createPartName("/default.xml"),
        ContentTypes.PLAIN_OLD_XML);
    // Initialise some PackageBase properties
    pkg.packageProperties = new PackagePropertiesPart(pkg,
        PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    pkg.packageProperties.setCreatorProperty("Generated by Apache POI OpenXML4J");
    pkg.packageProperties.setCreatedProperty(Optional.of(new Date()));
  } catch (InvalidFormatException e) {
    // Should never happen
    throw new IllegalStateException(e);
  }
}

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

/**
 * Configure the package.
 *
 * @param pkg
 */
private static void configurePackage(OPCPackage pkg) {
  try {
    // Content type manager
    pkg.contentTypeManager = new ZipContentTypeManager(null, pkg);
    // Add default content types for .xml and .rels
    pkg.contentTypeManager
        .addContentType(
            PackagingURIHelper
                .createPartName(PackagingURIHelper.PACKAGE_RELATIONSHIPS_ROOT_URI),
            ContentTypes.RELATIONSHIPS_PART);
    pkg.contentTypeManager
        .addContentType(PackagingURIHelper
            .createPartName("/default.xml"),
            ContentTypes.PLAIN_OLD_XML);
    // Init some PackageBase properties
    pkg.packageProperties = new PackagePropertiesPart(pkg,
        PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
    pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
        new Date()));
  } catch (InvalidFormatException e) {
    // Should never happen
    throw new IllegalStateException(e);
  }
}

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

/**
 * Configure the package.
 * 
 * @param pkg
 */
private static void configurePackage(Package pkg) {
  try {
    // Content type manager
    pkg.contentTypeManager = new ZipContentTypeManager(null, pkg);
    // Add default content types for .xml and .rels
    pkg.contentTypeManager
        .addContentType(
            PackagingURIHelper
                .createPartName(PackagingURIHelper.PACKAGE_RELATIONSHIPS_ROOT_URI),
            ContentTypes.RELATIONSHIPS_PART);
    pkg.contentTypeManager
        .addContentType(PackagingURIHelper
            .createPartName("/default.xml"),
            ContentTypes.PLAIN_OLD_XML);
    // Init some Package properties
    pkg.packageProperties = new PackagePropertiesPart(pkg,
        PackagingURIHelper.CORE_PROPERTIES_PART_NAME);
    pkg.packageProperties.setCreatorProperty("Generated by OpenXML4J");
    pkg.packageProperties.setCreatedProperty(new Nullable<Date>(
        new Date()));
  } catch (InvalidFormatException e) {
    // Should never happen
    throw new IllegalStateException(e);
  }
}

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

this.contentTypeManager = new ZipContentTypeManager(
      zipArchive.getInputStream(contentTypeEntry), this);
} catch (IOException e) {

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

ContentTypeManager.CONTENT_TYPES_PART_NAME)) {
try {
  this.contentTypeManager = new ZipContentTypeManager(
      getZipArchive().getInputStream(entry), this);
} catch (IOException e) {

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