本文整理了Java中org.apache.commons.compress.archivers.zip.Zip64RequiredException
类的一些代码示例,展示了Zip64RequiredException
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zip64RequiredException
类的具体详情如下:
包路径:org.apache.commons.compress.archivers.zip.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));
}
}
内容来源于网络,如有侵权,请联系作者删除!