- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中java.util.zip.ZipException.getMessage()
方法的一些代码示例,展示了ZipException.getMessage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipException.getMessage()
方法的具体详情如下:
包路径:java.util.zip.ZipException
类名称:ZipException
方法名:getMessage
暂无
代码示例来源:origin: blynkkk/blynk-server
private void addZipEntryAndWrite(ZipOutputStream zipStream,
String onePinFileName, byte[] onePinDataCsv) throws IOException {
ZipEntry zipEntry = new ZipEntry(onePinFileName);
try {
zipStream.putNextEntry(zipEntry);
zipStream.write(onePinDataCsv);
zipStream.closeEntry();
} catch (ZipException zipException) {
String message = zipException.getMessage();
if (message != null && message.contains("duplicate")) {
log.warn("Duplicate zip entry {}. Wrong report configuration.", onePinFileName);
} else {
log.error("Error compressing report file.", message);
throw zipException;
}
} catch (IOException e) {
log.error("Error compressing report file.", e.getMessage());
throw e;
}
}
代码示例来源:origin: org.netbeans.api/org-openide-filesystems
/**
* @return the jar
*/
private JarFile getJar(boolean create) {
assert Thread.holdsLock(closeSync);
if (jar == null && create) {
try {
if (root.canRead()) {
jar = new JarFile(root);
LOGGER.log(Level.FINE, "opened: {0} {1}", new Object[]{root.getAbsolutePath(), System.currentTimeMillis()}); //NOI18N
return jar;
}
} catch (ZipException ex) {
dumpFDs();
LOGGER.log(Level.INFO, ex.getMessage(), ex);
} catch (IOException ex) {
LOGGER.log(Level.INFO, ex.getMessage(), ex);
}
LOGGER.log(Level.WARNING, "cannot open {0}", root.getAbsolutePath()); // NOI18N
}
return jar;
}
代码示例来源:origin: org.apache.ant/ant
/**
* Sets the central directory part of extra fields.
*
* @param b boolean
*/
public void setCentralDirectoryExtra(final byte[] b) {
try {
final ZipExtraField[] central = ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (final ZipException e) {
throw new RuntimeException(e.getMessage(), e); //NOSONAR
}
}
代码示例来源:origin: alibaba/mdrill
/**
* Sets the central directory part of extra fields.
*/
public void setCentralDirectoryExtra(byte[] b) {
try {
ZipExtraField[] central =
ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (ZipException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Sets the central directory part of extra fields.
* @param b an array of bytes to be parsed into extra fields
*/
public void setCentralDirectoryExtra(final byte[] b) {
try {
final ZipExtraField[] central =
ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (final ZipException e) {
throw new RuntimeException(e.getMessage(), e); //NOSONAR
}
}
代码示例来源:origin: org.apache.poi/poi-ooxml
ZipArchiveEntry getNextEntry() throws IOException {
if (!(in instanceof ZipArchiveInputStream)) {
throw new IllegalStateException("getNextEntry() is only allowed for stream based zip processing.");
}
try {
entry = ((ZipArchiveInputStream) in).getNextZipEntry();
return entry;
} catch (ZipException ze) {
if (ze.getMessage().startsWith("Unexpected record signature")) {
throw new NotOfficeXmlFileException(
"No valid entries or contents found, this is not a valid OOXML (Office Open XML) file", ze);
}
throw ze;
}
}
代码示例来源:origin: org.apache.ant/ant
if (ex.getMessage().contains("duplicate")) {
代码示例来源:origin: GlowstoneMC/Glowstone
new GZIPInputStream(new ByteArrayInputStream(data), 2048)));
} catch (ZipException e) {
if (e.getMessage().equals("Not in GZIP format")) {
GlowServer.logger.info("Incorrect region version, switching to zlib...");
file.seek((sectorNumber * SECTOR_BYTES) + Integer.BYTES);
代码示例来源:origin: org.apache.commons/commons-compress
/**
* Parses the given bytes as extra field data and consumes any
* unparseable data as an {@link UnparseableExtraFieldData}
* instance.
* @param extra an array of bytes to be parsed into extra fields
* @throws RuntimeException if the bytes cannot be parsed
* @throws RuntimeException on error
*/
@Override
public void setExtra(final byte[] extra) throws RuntimeException {
try {
final ZipExtraField[] local =
ExtraFieldUtils.parse(extra, true,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(local, true);
} catch (final ZipException e) {
// actually this is not possible as of Commons Compress 1.1
throw new RuntimeException("Error parsing extra fields for entry: " //NOSONAR
+ getName() + " - " + e.getMessage(), e);
}
}
代码示例来源:origin: org.apache.ant/ant
/**
* Parses the given bytes as extra field data and consumes any
* unparseable data as an {@link UnparseableExtraFieldData}
* instance.
*
* @param extra an array of bytes to be parsed into extra fields
* @throws RuntimeException if the bytes cannot be parsed
* @throws RuntimeException on error
* @since 1.1
*/
@Override
public void setExtra(final byte[] extra) throws RuntimeException {
try {
final ZipExtraField[] local = ExtraFieldUtils.parse(extra, true,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(local, true);
} catch (final ZipException e) {
// actually this is not be possible as of Ant 1.8.1
throw new RuntimeException("Error parsing extra fields for entry: " //NOSONAR
+ getName() + " - " + e.getMessage(), e);
}
}
代码示例来源:origin: alibaba/mdrill
/**
* Parses the given bytes as extra field data and consumes any
* unparseable data as an {@link UnparseableExtraFieldData}
* instance.
* @param extra an array of bytes to be parsed into extra fields
* @throws RuntimeException if the bytes cannot be parsed
* @since 1.1
* @throws RuntimeException on error
*/
@Override
public void setExtra(byte[] extra) throws RuntimeException {
try {
ZipExtraField[] local =
ExtraFieldUtils.parse(extra, true,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(local, true);
} catch (ZipException e) {
// actually this is not be possible as of Ant 1.8.1
throw new RuntimeException("Error parsing extra fields for entry: "
+ getName() + " - " + e.getMessage(), e);
}
}
代码示例来源:origin: deathmarine/Luyten
if (!ze.getMessage().contains("duplicate")) {
throw ze;
代码示例来源:origin: drewnoakes/metadata-extractor
inflateStream.close();
} catch(java.util.zip.ZipException zex) {
directory.addError(String.format("Exception decompressing PNG iCCP chunk : %s", zex.getMessage()));
metadata.addDirectory(directory);
textBytes = null;
PngDirectory directory = new PngDirectory(PngChunkType.zTXt);
directory.addError(String.format("Exception decompressing PNG zTXt chunk with keyword \"%s\": %s", keyword, zex.getMessage()));
metadata.addDirectory(directory);
textBytes = null;
PngDirectory directory = new PngDirectory(PngChunkType.iTXt);
directory.addError(String.format("Exception decompressing PNG iTXt chunk with keyword \"%s\": %s", keyword, zex.getMessage()));
metadata.addDirectory(directory);
代码示例来源:origin: PrivacyApps/document-viewer
public ZipArchive(final File zipfile) throws IOException {
try {
this.zipfile = new ZipFile(zipfile);
} catch (final ZipException ex) {
final IOException exx = new IOException(ex.getMessage());
exx.initCause(ex);
throw exx;
}
}
代码示例来源:origin: de.julielab/julielab-java-utilities
public static BufferedInputStream getInputStreamFromUri(URI uri) throws IOException {
try {
String uriStr = uri.toString().toLowerCase();
return new BufferedInputStream(uriStr.endsWith(".gz") || uriStr.endsWith(".gzip") ?
new GZIPInputStream(uri.toURL().openStream()) :
uri.toURL().openStream());
} catch (ZipException e) {
log.error("URI {} target could not be uncompressed: {}", uri, e.getMessage());
throw e;
}
}
代码示例来源:origin: jolira/onejar-maven-plugin
private void addToZip(JarOutputStream out, ZipEntry entry, InputStream in) throws IOException {
try{
out.putNextEntry(entry);
IOUtils.copy(in, out);
out.closeEntry();
}catch(ZipException e){
if (e.getMessage().startsWith("duplicate entry")){
// A Jar with the same name was already added. Let's add this one using a modified name:
final ZipEntry alternativeEntry = new ZipEntry(entry.getName() + "-DUPLICATE-FILENAME-" + alternativeEntryCounter.incrementAndGet() + ".jar");
addToZip(out, alternativeEntry, in);
}else{
throw e;
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
ZipArchiveEntry getNextEntry() throws IOException {
if (!(in instanceof ZipArchiveInputStream)) {
throw new IllegalStateException("getNextEntry() is only allowed for stream based zip processing.");
}
try {
entry = ((ZipArchiveInputStream) in).getNextZipEntry();
return entry;
} catch (ZipException ze) {
if (ze.getMessage().startsWith("Unexpected record signature")) {
throw new NotOfficeXmlFileException(
"No valid entries or contents found, this is not a valid OOXML (Office Open XML) file", ze);
}
throw ze;
}
}
代码示例来源:origin: org.xbib/archive
/**
* Sets the central directory part of extra fields.
*/
public void setCentralDirectoryExtra(byte[] b) {
try {
ZipExtraField[] central =
ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (ZipException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
代码示例来源:origin: KostyaSha/yet-another-docker-plugin
/**
* Sets the central directory part of extra fields.
* @param b an array of bytes to be parsed into extra fields
*/
public void setCentralDirectoryExtra(final byte[] b) {
try {
final ZipExtraField[] central =
ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (final ZipException e) {
throw new RuntimeException(e.getMessage(), e); //NOSONAR
}
}
代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded
/**
* Sets the central directory part of extra fields.
* @param b an array of bytes to be parsed into extra fields
*/
public void setCentralDirectoryExtra(final byte[] b) {
try {
final ZipExtraField[] central =
ExtraFieldUtils.parse(b, false,
ExtraFieldUtils.UnparseableExtraField.READ);
mergeExtraFields(central, false);
} catch (final ZipException e) {
throw new RuntimeException(e.getMessage(), e); //NOSONAR
}
}
我只想提取一个普通的 zip 文件,但它总是失败。这是我现在使用的代码: private File downloadPath = new File(Environment.getExternalSto
我正在使用Firebase和API.AI开发Android聊天机器人应用程序。 将firebase UI库添加到项目后,我得到了 java.util.zip.ZipException:重复条目运行时异
我正在更新版本 3.4 的 Android studio 和插件(版本 5.1.1 的 gradle)当我尝试构建项目时,出现错误 java.util.zip.ZipException: zip fi
我遇到以下异常 java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Nati
我正在尝试将 zip 文件下载到 SD 卡。我正确下载了它,但是当我打开下载的文件(使用 ZipFile)时,我得到了这个 ZipException(“找不到中央目录条目”)。 Internet 文件
从今天早上开始(我更新了一些插件,并更新了 mac os X),每当系统想要读取 jar/zip 文件时,我都会收到 ZipException。起初我以为这是新版本插件中的一个错误,但它似乎是相当低级
这个问题在这里已经有了答案: Invalid Entry Compressed Size (2 个答案) 关闭 9 年前。 我正在尝试创建一种方法,只需一个步骤即可将多个 zip 存档相互融合。该代
我使用 Tomcat 8 和此类 Jersey 的动态 Web 项目依赖项。 com.sun.jersey jersey-client
我正在尝试将MoPub集成到我的应用程序中。 我将SDK导入了我的应用程序: compile('com.mopub.sdk.android:mopub:4.4.1@aar') { transi
Server: jboss-5.1.0 Java Version: jdk1.6.0_14 Deployment Method: ant v1.7 Error: 08:40:04,260 WARN [
我从事 Java 编程已有大约 15 年了。虽然这是一个基本问题,但这并不是因为故意无视 Java API 或阅读文档。坦率地说,我真的很震惊,我遇到了一种情况,我无法使用命令行工具创建一个简单的 j
我正在构建一个项目,其中有两个类(A 和 B)都继承自 BaseClass。 A 和 B 两个类都有 @Parceler 注释。当我为操作系统版本 4.1.2 (API 16) 的手机构建它时,它给了
我正在尝试使用以下命令更新现有 jar(在此示例中为 antlr)中的文件: jar -uf antlrworks-1.2.3.jar org/antlr/codegen/templates/Java
我一直在尝试让 ant 执行一些用 junit 编写的测试,但没有成功。任何建议将不胜感激。我对 ant 和 Java 都很陌生,所以请耐心等待。 作为快速总结,我正在做的是尝试让 ant 执行一个非
我正在将应用程序从 2.3 升级到 Nougat (SDK 25)。当我添加 com.android.support:appcompat-v7:25.0.0 以支持 ActivityCompat.re
这个问题在这里已经有了答案: How to resolve java.util.zip.ZipException? (11 个答案) 关闭 7 年前。 我正在尝试使用新的 multidex 选项,但
我对使用 Java 处理 zip 文件完全陌生,我遇到了一个奇怪的情况。 这是我用来解压的方法: public void unzip(File zipFile, File rootDir) throw
我在我的 Android 应用程序中使用 EBS 支付网关。 EBS 在其文件夹中包含 volley 库。我还为我的项目使用了 volley 库。所以我得到了这样的异常。 Execution fail
本文整理了Java中java.util.zip.ZipException.getLocalizedMessage()方法的一些代码示例,展示了ZipException.getLocalizedMess
本文整理了Java中java.util.zip.ZipException.()方法的一些代码示例,展示了ZipException.()的具体用法。这些代码示例主要来源于Github/Stackover
我是一名优秀的程序员,十分优秀!