本文整理了Java中io.ultreia.java4all.util.Zips
类的一些代码示例,展示了Zips
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zips
类的具体详情如下:
包路径:io.ultreia.java4all.util.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];
内容来源于网络,如有侵权,请联系作者删除!