gpt4 book ai didi

io.ultreia.java4all.util.Zips类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 10:52:32 25 4
gpt4 key购买 nike

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

Zips介绍

[英]Created by tchemit on 30/12/2017.
[中]tchemit于2017年12月30日创建。

代码示例

代码示例来源:origin: io.ultreia.java4all/java-util

/**
 * Uncompress zipped stream in targetDir.
 *
 * @param stream    the zip source stream, stream is closed before return
 * @param targetDir the destination directory
 * @throws IOException if any problem while unzip
 * @since 2.6.6
 */
public static void uncompress(InputStream stream, File targetDir) throws IOException {
  uncompressAndRename(stream, targetDir, null, null);
}

代码示例来源:origin: io.ultreia.java4all/java-util

File target = new File(targetDir, name);
if (entry.isDirectory()) {
  createDirectoryIfNecessary(target);
} else {
  createDirectoryIfNecessary(target.getParentFile());
  try (InputStream in = zipFile.getInputStream(entry)) {
    try (OutputStream out = new BufferedOutputStream(new FileOutputStream(target))) {

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime-application

@Override
  protected void createUserI18nLayout(Path directory, I18nLanguageProvider delegateLanguageProvider) throws Exception {
    if (config.getI18nDefinitionFile().exists()) {
      return;
    }
    super.createUserI18nLayout(directory,delegateLanguageProvider);
    // add also a archive with all i18n stuff (says i18n bundle + templates)
    URL resource = resourceManager.getResourceUrl(I18N_ARCHIVE);
    File archive = new File(directory.getParent().toFile(), resourceManager.getResourceFilename(I18N_ARCHIVE));
    try {
      getResourceManager().copyResource(resource, archive, String.format("%s Copy i18n archive", ApplicationBoot.BOOT_LOG_PREFIX));
      Zips.uncompressFiltred(archive, directory.toFile().getParentFile());
    } finally {
      if (Files.exists(archive.toPath())) {
        try {
          Files.delete(archive.toPath());
        } catch (IOException e) {
          log.error(String.format("Could not delete i18n archive %s", archive));
        }
      }
    }
  }
};

代码示例来源:origin: io.ultreia.java4all.jaxx/jaxx-runtime-application

public void unzipToDirectory(String resourceName, ApplicationConfiguration config, ConfigOptionDef option) throws IOException {
  File dir = config.get().getOptionAsFile(option.getKey());
  createDirectory(dir);
  URL resourceUrl = getResourceUrl(resourceName);
  try (InputStream inputStream = openInternalStream(resourceUrl)) {
    Zips.uncompress(inputStream, dir);
  }
}

代码示例来源:origin: io.ultreia.java4all/java-util

createDirectoryIfNecessary(target);
} else {
  createDirectoryIfNecessary(target.getParentFile());
  try (OutputStream out = new BufferedOutputStream(new FileOutputStream(target))) {
    byte[] buffer = new byte[BUFFER_SIZE];

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