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

x33g5p2x  于2022-02-05 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(299)

本文整理了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);

相关文章