gpt4 book ai didi

org.zeroturnaround.zip.ZipUtil.containsEntry()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 12:22:40 28 4
gpt4 key购买 nike

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

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;

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