本文整理了Java中org.molgenis.util.file.ZipFileUtil
类的一些代码示例,展示了ZipFileUtil
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipFileUtil
类的具体详情如下:
包路径:org.molgenis.util.file.ZipFileUtil
类名称:ZipFileUtil
暂无
代码示例来源:origin: molgenis/molgenis
/**
* Unzips a zipfile into the directory it resides in. Skips paths starting with '.' or '_'
* (typically hidden paths).
*
* @param file the file to unzip
* @return List of Files that got extracted
* @throws UnzipException if something went wrong
*/
public static List<File> unzipSkipHidden(File file) {
return unzip(file, name -> name.startsWith(".") || name.startsWith("_") ? null : name);
}
代码示例来源:origin: org.molgenis/molgenis-one-click-importer
List<File> filesInZip;
try {
filesInZip = ZipFileUtil.unzipSkipHidden(file);
} catch (UnzipException zipException) {
throw new CodedUnzipException(file.getName(), zipException);
代码示例来源:origin: org.molgenis/molgenis-ontology-core
uploadedFiles = ZipFileUtil.unzipSkipHidden(file);
} catch (UnzipException unzipException) {
throw new CodedUnzipException(file.getName(), unzipException);
代码示例来源:origin: org.molgenis/molgenis-app-manager
@Override
public String uploadApp(InputStream zipData, String zipFileName, String formFieldName)
throws IOException {
String tempFilesDir = "extracted_" + zipFileName;
String tempAppDirectoryName = APPS_TMP_DIR + separator + tempFilesDir;
fileStore.createDirectory(tempAppDirectoryName);
try {
ZipFileUtil.unzip(zipData, fileStore.getFile(tempAppDirectoryName));
} catch (UnzipException unzipException) {
fileStore.delete(tempAppDirectoryName);
throw new InvalidAppArchiveException(formFieldName, unzipException);
}
List<String> missingRequiredFilesList = buildMissingRequiredFiles(tempAppDirectoryName);
if (!missingRequiredFilesList.isEmpty()) {
fileStore.deleteDirectory(APPS_TMP_DIR);
throw new AppArchiveMissingFilesException(missingRequiredFilesList);
}
return tempAppDirectoryName;
}
内容来源于网络,如有侵权,请联系作者删除!