gpt4 book ai didi

java.util.zip.ZipException.printStackTrace()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-17 13:28:40 25 4
gpt4 key购买 nike

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

ZipException.printStackTrace介绍

暂无

代码示例

代码示例来源:origin: genjava/gj-core

/**
 * Close the zip file.
 */
public void close() {
  try {
    zipout.close();
  } catch(ZipException ze) {
    ze.printStackTrace();
    return;
  } catch(IOException ioe) {
    ioe.printStackTrace();
    return;
  }
}

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

private List<String> load(File jarFile) throws IOException {
  List<String> jarContents = new ArrayList<String>();
  try {
    ZipFile zf = new ZipFile(jarFile);
    for (Enumeration e = zf.entries(); e.hasMoreElements();) {
      ZipEntry ze = (ZipEntry) e.nextElement();
      if (ze.isDirectory()) {
        continue;
      }
      jarContents.add(ze.getName());
    }
  } catch (NullPointerException e) {
    System.out.println("done.");
  } catch (ZipException ze) {
    ze.printStackTrace();
  }
  return jarContents;
}

代码示例来源:origin: org.apache.cxf/cxf-api

private List<String> load(File jarFile) throws IOException {
  List<String> jarContents = new ArrayList<String>();
  try {
    ZipFile zf = new ZipFile(jarFile);
    for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements();) {
      ZipEntry ze = e.nextElement();
      if (ze.isDirectory()) {
        continue;
      }
      jarContents.add(ze.getName());
    }
    zf.close();
  } catch (NullPointerException e) {
    System.out.println("done.");
  } catch (ZipException ze) {
    ze.printStackTrace();
  }
  return jarContents;
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

private List<String> load(File jarFile) throws IOException {
  List<String> jarContents = new ArrayList<String>();
  try {
    ZipFile zf = new ZipFile(jarFile);
    for (Enumeration<? extends ZipEntry> e = zf.entries(); e.hasMoreElements();) {
      ZipEntry ze = e.nextElement();
      if (ze.isDirectory()) {
        continue;
      }
      jarContents.add(ze.getName());
    }
    zf.close();
  } catch (NullPointerException e) {
    System.out.println("done.");
  } catch (ZipException ze) {
    ze.printStackTrace();
  }
  return jarContents;
}

代码示例来源:origin: genjava/gj-core

/**
 * Add the passed in String data to the Zip under the specified 
 * filename.
 */
public boolean addFile(String filename, String contents) {
  // test if this dir has been written to yet?
  try {
    ZipEntry entry = new ZipEntry(filename);
    entry.setTime(System.currentTimeMillis());
    entry.setSize(contents.length());   // *2?
    zipout.putNextEntry(entry);
    zipout.write(contents.getBytes());
    zipout.closeEntry();
    return true;
  } catch(ZipException ze) {
    ze.printStackTrace();
    return false;
  } catch(IOException ioe) {
    ioe.printStackTrace();
    return false;
  }
}

代码示例来源:origin: Spoutcraft/LegacyLauncher

zipEx.printStackTrace();
} catch (Exception e) {
  e.printStackTrace();

代码示例来源:origin: TechnicPack/LauncherCore

@Override
  public void runTask(InstallTasksQueue queue) throws IOException, InterruptedException {
    super.runTask(queue);

    if (!zipFile.exists()) {
      throw new ZipException("Attempting to extract file " + zipFile.getName() + ", but it did not exist.");
    }

    if (!destination.exists()) {
      destination.mkdirs();
    }

    try {
      ZipUtils.unzipFile(zipFile, destination, filter, this);
    } catch (ZipException ex) {
      ex.printStackTrace();
      throw new ZipException("Error extracting file "+zipFile.getName()+".");
    }
  }
}

代码示例来源:origin: TechnicPack/LauncherCore

public static boolean extractFile(File zip, File output, String fileName) throws IOException, InterruptedException {
  if (!zip.exists() || fileName == null) {
    return false;
  }
  ZipFile zipFile = null;
  try {
    zipFile = new ZipFile(zip);
    ZipEntry entry = zipFile.getEntry(fileName);
    if (entry == null) {
      Utils.getLogger().log(Level.WARNING, "File " + fileName + " not found in " + zip.getAbsolutePath());
      return false;
    }
    File outputFile = new File(output, entry.getName());
    if (outputFile.getParentFile() != null) {
      outputFile.getParentFile().mkdirs();
    }
    unzipEntry(zipFile, zipFile.getEntry(fileName), outputFile);
    return true;
  } catch (ZipException e) {
    e.printStackTrace();
    throw new ZipException("Error extracting file " + zip.getName());
  } catch (IOException e) {
    Utils.getLogger().log(Level.WARNING, "Error extracting file " + fileName + " from " + zip.getAbsolutePath());
    return false;
  } finally {
    if (zipFile != null) {
      zipFile.close();
    }
  }
}

代码示例来源:origin: com.bbossgroups.pdp/pdp-cms

} catch (ZipException e) {
  e.printStackTrace();
} catch (IOException e) {

代码示例来源:origin: FreedomZZQ/YouJoin-Android

e.printStackTrace();
} catch (IOException e) {

代码示例来源:origin: ItzSomebody/Radon

e.printStackTrace();
} catch (IOException e) {
  LoggerUtils.stdErr(String.format("IOException happened while trying to load classes from \"%s\".", file.getAbsolutePath()));

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

public JarFile getJarFile(String jarFileName) {
  JarFile jarFile = jarFiles.get(jarFileName);
  if(null == jarFile) {
    try {
      jarFile = new JarFile(jarFileName);
      jarFiles.put(jarFileName, jarFile);
    } catch (ZipException ignored) {
      if (runtime.getInstanceConfig().isDebug()) {
        LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
        ignored.printStackTrace(runtime.getErr());
      }
    } catch (FileNotFoundException ignored) {
    } catch (IOException e) {
      throw runtime.newIOErrorFromException(e);
    }
  }
  return jarFile;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

public JarFile getJarFile(String jarFileName) {
  JarFile jarFile = jarFiles.get(jarFileName);
  if(null == jarFile) {
    try {
      jarFile = new JarFile(jarFileName);
      jarFiles.put(jarFileName, jarFile);
    } catch (ZipException ignored) {
      if (runtime.getInstanceConfig().isDebug()) {
        LOG.info("ZipException trying to access " + jarFileName + ", stack trace follows:");
        ignored.printStackTrace(runtime.getErr());
      }
    } catch (FileNotFoundException ignored) {
    } catch (IOException e) {
      throw runtime.newIOErrorFromException(e);
    }
  }
  return jarFile;
}

代码示例来源:origin: IQSS/dataverse

e.printStackTrace();
} catch (IOException e) {

代码示例来源:origin: ItzSomebody/Radon

e.printStackTrace();
  throw new BadInputException();
} catch (IOException e) {

代码示例来源:origin: openpreserve/format-corpus

} catch (ZipException excep) {
  System.err.println("Folder: " + folder.getAbsolutePath() + " does not appear to be a valid zip file.");
  excep.printStackTrace();
  continue;
} catch (IOException excep) {

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.eclipse.equinox.p2.jarprocessor

} catch (ZipException e) {
  if (options.verbose)
    e.printStackTrace();
} catch (IOException e) {
  if (options.verbose)

代码示例来源:origin: com.github.veithen.cosmos.bootstrap/org.eclipse.equinox.p2.jarprocessor

} catch (ZipException e) {
  if (options.verbose)
    e.printStackTrace();
} catch (IOException e) {
  if (options.verbose)

代码示例来源:origin: org.eclipse.equinox.p2/jarprocessor

} catch (ZipException e) {
  if (options.verbose)
    e.printStackTrace();
} catch (IOException e) {
  if (options.verbose)

代码示例来源:origin: com.bbossgroups.pdp/pdp-cms

FileUtil.upzip(packagedTemplate, currTemplateFolder.getAbsolutePath());
} catch (ZipException e) {
  e.printStackTrace();
  throw new TemplateManagerException("解压缩模板文件包发生错误!");
} catch (IOException e) {

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