本文整理了Java中org.zeroturnaround.zip.ZipUtil.containsEntry()
方法的一些代码示例,展示了ZipUtil.containsEntry()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtil.containsEntry()
方法的具体详情如下:
包路径:org.zeroturnaround.zip.ZipUtil
类名称:ZipUtil
方法名:containsEntry
[英]Checks if the ZIP file contains the given entry.
[中]检查ZIP文件是否包含给定的条目。
代码示例来源:origin: zeroturnaround/zt-zip
/**
* Alias to ZipUtil.containsEntry()
*
* @param name
* entry to check existence of
* @return true if zip archive we're processing contains entry by given name, false otherwise
*/
public boolean containsEntry(String name) {
if (src == null) {
throw new IllegalStateException("Source is not given");
}
return ZipUtil.containsEntry(src, name);
}
代码示例来源:origin: jphp-group/jphp
@Signature
public boolean has(String path) {
return ZipUtil.containsEntry(zipFile, path);
}
代码示例来源:origin: org.zeroturnaround/zt-zip
/**
* Alias to ZipUtil.containsEntry()
*
* @param name
* entry to check existence of
* @return true if zip archive we're processing contains entry by given name, false otherwise
*/
public boolean containsEntry(String name) {
if (src == null) {
throw new IllegalStateException("Source is not given");
}
return ZipUtil.containsEntry(src, name);
}
代码示例来源:origin: PlayPen/playpen-core
public P3Package readPackage(File file) throws PackageException {
try {
if (!ZipUtil.containsEntry(file, "package.json")) {
throw new PackageException("No package schema found");
}
byte[] schemaBytes = ZipUtil.unpackEntry(file, "package.json");
String schemaString = new String(schemaBytes);
JSONObject schema = new JSONObject(schemaString);
P3Package p3 = readSchema(schema);
p3.setLocalPath(file.getPath());
return p3;
}
catch(JSONException e) {
throw new PackageException("Invalid package schema", e);
}
}
代码示例来源:origin: PlayPen/playpen-core
if(!ZipUtil.containsEntry(jarFile, "plugin.json")) {
log.warn("Jar " + jarFile.getPath() + " does not contain a plugin.json");
continue;
if (ZipUtil.containsEntry(jarFile, "config.json")) {
schema.getFiles().add("config.json");
if (!ZipUtil.containsEntry(jarFile, filename)) {
log.error("Plugin file " + filename + " for " + schema.getId() + " doesn't exist in jar");
return false;
if(ZipUtil.containsEntry(jarFile, "config.json")) {
File configFile = Paths.get(pluginDir.getPath(), "config.json").toFile();
byte[] configBytes = null;
内容来源于网络,如有侵权,请联系作者删除!