gpt4 book ai didi

net.lingala.zip4j.core.ZipFile.getInputStream()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-16 13:34:40 27 4
gpt4 key购买 nike

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

ZipFile.getInputStream介绍

[英]Returns an input stream for reading the contents of the Zip file corresponding to the input FileHeader. Throws an exception if the FileHeader does not exist in the ZipFile
[中]返回用于读取与输入文件头对应的Zip文件内容的输入流。如果ZipFile中不存在FileHeader,则引发异常

代码示例

代码示例来源:origin: io.thorntail/tools

@Override
  public InputStream openStream() {
    try {
      return zipFile.getInputStream(fileHeader);
    } catch (ZipException e) {
      throw new RuntimeException("Could not open zip file stream", e);
    }
  }
}

代码示例来源:origin: org.wildfly.swarm/tools

@Override
  public InputStream openStream() {
    try {
      return zipFile.getInputStream(fileHeader);
    } catch (ZipException e) {
      throw new RuntimeException("Could not open zip file stream", e);
    }
  }
}

代码示例来源:origin: org.jboss.forge.addon/resources-impl

@Override
public InputStream getResourceInputStream()
{
 try
 {
   return getZipFile().getInputStream(fileHeader);
 }
 catch (ZipException e)
 {
   throw new ResourceException("Error while fetching zip contents", e);
 }
}

代码示例来源:origin: MCMrARM/revolution-irc

zipFile.setPassword(password);
Reader reader = new BufferedReader(new InputStreamReader(zipFile.getInputStream(
    zipFile.getFileHeader(BACKUP_PREFERENCES_PATH))));
importPreferencesFromJson(context, reader);
  if (fileHeader.getFileName().startsWith(BACKUP_SERVER_PREFIX) &&
      fileHeader.getFileName().endsWith(BACKUP_SERVER_SUFFIX)) {
    reader = new BufferedReader(new InputStreamReader(zipFile.getInputStream(
        fileHeader)));
    ServerConfigData data = SettingsHelper.getGson().fromJson(reader,
        UUID.fromString(uuid));
    try {
      helper.loadKeyStore(zipFile.getInputStream(fileHeader));
      helper.saveKeyStore();
    } catch (GeneralSecurityException exception) {
reader = new BufferedReader(new InputStreamReader(zipFile.getInputStream(
    zipFile.getFileHeader(BACKUP_NOTIFICATION_RULES_PATH))));
NotificationRuleManager.loadUserRuleSettings(reader);
NotificationRuleManager.saveUserRuleSettings(context);
reader = new BufferedReader(new InputStreamReader(zipFile.getInputStream(
    zipFile.getFileHeader(BACKUP_COMMAND_ALIASES_PATH))));
CommandAliasManager aliasManager = CommandAliasManager.getInstance(context);

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