gpt4 book ai didi

org.apache.commons.compress.archivers.zip.Zip64RequiredException类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 09:52:11 30 4
gpt4 key购买 nike

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

Zip64RequiredException介绍

[英]Exception thrown when attempting to write data that requires Zip64 support to an archive and ZipArchiveOutputStream#setUseZip64 has been set to Zip64Mode#Never.
[中]尝试将需要Zip64支持的数据写入存档时引发异常,ZipArchiveOutputStream#setUseZip64已设置为Zip64Mode#Never。

代码示例

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * Verifies the sizes aren't too big in the Zip64Mode.Never case
 * and returns whether the entry would require a Zip64 extra
 * field.
 */
private boolean checkIfNeedsZip64(final Zip64Mode effectiveMode)
    throws ZipException {
  final boolean actuallyNeedsZip64 = isZip64Required(entry.entry, effectiveMode);
  if (actuallyNeedsZip64 && effectiveMode == Zip64Mode.Never) {
    throw new Zip64RequiredException(Zip64RequiredException.getEntryTooBigMessage(entry.entry));
  }
  return actuallyNeedsZip64;
}

代码示例来源:origin: org.apache.commons/commons-compress

if (numberOfEntries > ZIP64_MAGIC_SHORT
  && zip64Mode == Zip64Mode.Never) {
  throw new Zip64RequiredException(Zip64RequiredException
                   .TOO_MANY_ENTRIES_MESSAGE);
  throw new Zip64RequiredException(Zip64RequiredException
                   .ARCHIVE_TOO_BIG_MESSAGE);

代码示例来源:origin: org.apache.commons/commons-compress

private byte[] createCentralFileHeader(final ZipArchiveEntry ze) throws IOException {
  final EntryMetaData entryMetaData = metaData.get(ze);
  final boolean needsZip64Extra = hasZip64Extra(ze)
      || ze.getCompressedSize() >= ZIP64_MAGIC
      || ze.getSize() >= ZIP64_MAGIC
      || entryMetaData.offset >= ZIP64_MAGIC
      || zip64Mode == Zip64Mode.Always;
  if (needsZip64Extra && zip64Mode == Zip64Mode.Never) {
    // must be the offset that is too big, otherwise an
    // exception would have been throw in putArchiveEntry or
    // closeArchiveEntry
    throw new Zip64RequiredException(Zip64RequiredException
        .ARCHIVE_TOO_BIG_MESSAGE);
  }
  handleZip64Extra(ze, entryMetaData.offset, needsZip64Extra);
  return createCentralFileHeader(ze, getName(ze), entryMetaData, needsZip64Extra);
}

代码示例来源:origin: org.apache.commons/commons-compress

/**
 * Throws an exception if the size is unknown for a stored entry
 * that is written to a non-seekable output or the entry is too
 * big to be written without Zip64 extra but the mode has been set
 * to Never.
 */
private void validateSizeInformation(final Zip64Mode effectiveMode)
  throws ZipException {
  // Size/CRC not required if SeekableByteChannel is used
  if (entry.entry.getMethod() == STORED && channel == null) {
    if (entry.entry.getSize() == ArchiveEntry.SIZE_UNKNOWN) {
      throw new ZipException("uncompressed size is required for"
                  + " STORED method when not writing to a"
                  + " file");
    }
    if (entry.entry.getCrc() == ZipArchiveEntry.CRC_UNKNOWN) {
      throw new ZipException("crc checksum is required for STORED"
                  + " method when not writing to a file");
    }
    entry.entry.setCompressedSize(entry.entry.getSize());
  }
  if ((entry.entry.getSize() >= ZIP64_MAGIC
     || entry.entry.getCompressedSize() >= ZIP64_MAGIC)
    && effectiveMode == Zip64Mode.Never) {
    throw new Zip64RequiredException(Zip64RequiredException
                     .getEntryTooBigMessage(entry.entry));
  }
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

if (numberOfEntries > ZIP64_MAGIC_SHORT
  && zip64Mode == Zip64Mode.Never) {
  throw new Zip64RequiredException(Zip64RequiredException
                   .TOO_MANY_ENTRIES_MESSAGE);
  throw new Zip64RequiredException(Zip64RequiredException
                   .ARCHIVE_TOO_BIG_MESSAGE);

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Verifies the sizes aren't too big in the Zip64Mode.Never case
 * and returns whether the entry would require a Zip64 extra
 * field.
 */
private boolean checkIfNeedsZip64(final Zip64Mode effectiveMode)
    throws ZipException {
  final boolean actuallyNeedsZip64 = isZip64Required(entry.entry, effectiveMode);
  if (actuallyNeedsZip64 && effectiveMode == Zip64Mode.Never) {
    throw new Zip64RequiredException(Zip64RequiredException.getEntryTooBigMessage(entry.entry));
  }
  return actuallyNeedsZip64;
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

private byte[] createCentralFileHeader(final ZipArchiveEntry ze) throws IOException {
  final EntryMetaData entryMetaData = metaData.get(ze);
  final boolean needsZip64Extra = hasZip64Extra(ze)
      || ze.getCompressedSize() >= ZIP64_MAGIC
      || ze.getSize() >= ZIP64_MAGIC
      || entryMetaData.offset >= ZIP64_MAGIC
      || zip64Mode == Zip64Mode.Always;
  if (needsZip64Extra && zip64Mode == Zip64Mode.Never) {
    // must be the offset that is too big, otherwise an
    // exception would have been throw in putArchiveEntry or
    // closeArchiveEntry
    throw new Zip64RequiredException(Zip64RequiredException
        .ARCHIVE_TOO_BIG_MESSAGE);
  }
  handleZip64Extra(ze, entryMetaData.offset, needsZip64Extra);
  return createCentralFileHeader(ze, getName(ze), entryMetaData, needsZip64Extra);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Throws an exception if the size is unknown for a stored entry
 * that is written to a non-seekable output or the entry is too
 * big to be written without Zip64 extra but the mode has been set
 * to Never.
 */
private void validateSizeInformation(final Zip64Mode effectiveMode)
  throws ZipException {
  // Size/CRC not required if SeekableByteChannel is used
  if (entry.entry.getMethod() == STORED && channel == null) {
    if (entry.entry.getSize() == ArchiveEntry.SIZE_UNKNOWN) {
      throw new ZipException("uncompressed size is required for"
                  + " STORED method when not writing to a"
                  + " file");
    }
    if (entry.entry.getCrc() == ZipArchiveEntry.CRC_UNKNOWN) {
      throw new ZipException("crc checksum is required for STORED"
                  + " method when not writing to a file");
    }
    entry.entry.setCompressedSize(entry.entry.getSize());
  }
  if ((entry.entry.getSize() >= ZIP64_MAGIC
     || entry.entry.getCompressedSize() >= ZIP64_MAGIC)
    && effectiveMode == Zip64Mode.Never) {
    throw new Zip64RequiredException(Zip64RequiredException
                     .getEntryTooBigMessage(entry.entry));
  }
}

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