本文整理汇总了Java中java.util.zip.ZipException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ZipException.getMessage方法的具体用法?Java ZipException.getMessage怎么用?Java ZipException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.util.zip.ZipException
的用法示例。
在下文中一共展示了ZipException.getMessage方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeZipWithClasses
import java.util.zip.ZipException; //导入方法依赖的package包/类
private static void writeZipWithClasses(List<Path> inputs, D8Output output, Path path)
throws IOException {
try (Closer closer = Closer.create()) {
try (ZipOutputStream out = new ZipOutputStream(Files.newOutputStream(path))) {
// For each input archive file, add all class files within.
for (Path input : inputs) {
if (isArchive(input)) {
try (ZipInputStream in = new ZipInputStream(Files.newInputStream(input))) {
ZipEntry entry;
while ((entry = in.getNextEntry()) != null) {
if (isClassFile(Paths.get(entry.getName()))) {
addEntry(entry.getName(), in, out);
}
}
} catch (ZipException e) {
throw new CompilationError(
"Zip error while reading '" + input + "': " + e.getMessage(), e);
}
}
}
// Add dex files.
List<Resource> dexProgramSources = output.getDexResources();
for (int i = 0; i < dexProgramSources.size(); i++) {
addEntry(getDexFileName(i), closer.register(dexProgramSources.get(i).getStream()), out);
}
}
}
}
示例2: streamContent
import java.util.zip.ZipException; //导入方法依赖的package包/类
/**
* Content accessor.
*
* @return InputStream
*/
@Override
public InputStream streamContent()
throws IOException {
try {
if (binaryContent == null) {
InputStream is = base.getInputStream(entry);
inputStream = is;
return is;
}
} catch (ZipException e) {
throw new IOException(e.getMessage(), e);
}
return super.streamContent();
}
示例3: streamContent
import java.util.zip.ZipException; //导入方法依赖的package包/类
/**
* Content accessor.
*
* @return InputStream
*/
public InputStream streamContent()
throws IOException {
try {
if (binaryContent == null) {
inputStream = base.getInputStream(entry);
}
} catch (ZipException e) {
throw new IOException(e.getMessage());
}
return super.streamContent();
}
示例4: streamContent
import java.util.zip.ZipException; //导入方法依赖的package包/类
/**
* Content accessor.
*
* @return InputStream
*/
@Override
public InputStream streamContent() throws IOException {
try {
if (binaryContent == null) {
InputStream is = base.getInputStream(entry);
inputStream = is;
return is;
}
} catch (ZipException e) {
throw new IOException(e.getMessage(), e);
}
return super.streamContent();
}