- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils
类的一些代码示例,展示了ZipUtils
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZipUtils
类的具体详情如下:
包路径:de.tudarmstadt.ukp.clarin.webanno.support.ZipUtils
类名称:ZipUtils
[英]A utility class.
[中]实用课。
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-project
/**
* copy project log files from the exported project
* @param zip the ZIP file.
* @param aProject the project.
* @throws IOException if an I/O error occurs.
*/
@SuppressWarnings("rawtypes")
@Deprecated
private void createProjectLog(ZipFile zip, Project aProject)
throws IOException
{
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
ZipEntry entry = (ZipEntry) zipEnumerate.nextElement();
// Strip leading "/" that we had in ZIP files prior to 2.0.8 (bug #985)
String entryName = ZipUtils.normalizeEntryName(entry);
if (entryName.startsWith(LOG_FOLDER + "/")) {
FileUtils.copyInputStreamToFile(zip.getInputStream(entry),
getProjectLogFile(aProject));
log.info("Imported log for project [" + aProject.getName() + "] with id ["
+ aProject.getId() + "]");
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao
ZipUtils.zipFolder(exportTempDir, projectZipFile);
代码示例来源:origin: webanno/webanno
private static void addToZip(ZipOutputStream zip, File aBasePath, File aPath)
throws IOException
{
if (aPath.isDirectory()) {
for (File file : aPath.listFiles()) {
addToZip(zip, aBasePath, file);
}
}
else {
FileInputStream in = null;
try {
in = new FileInputStream(aPath);
String relativePath = aBasePath.toURI().relativize(aPath.toURI()).getPath();
zip.putNextEntry(new ZipEntry(relativePath));
IOUtils.copy(in, zip);
}
finally {
closeQuietly(in);
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-remote
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new UnsupportedFormatException("Invalid ZIP file");
代码示例来源:origin: webanno/webanno
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new UnsupportedFormatException("Invalid ZIP file");
代码示例来源:origin: webanno/webanno
/**
* copy Project META_INF from the exported project
* @param zip the ZIP file.
* @param aProject the project.
* @throws IOException if an I/O error occurs.
*/
@Deprecated
@SuppressWarnings("rawtypes")
private void createProjectMetaInf(ZipFile zip, Project aProject)
throws IOException
{
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
ZipEntry entry = (ZipEntry) zipEnumerate.nextElement();
// Strip leading "/" that we had in ZIP files prior to 2.0.8 (bug #985)
String entryName = ZipUtils.normalizeEntryName(entry);
if (entryName.startsWith(META_INF_FOLDER + "/")) {
File metaInfDir = new File(getMetaInfFolder(aProject),
FilenameUtils.getPath(entry.getName().replace(META_INF_FOLDER + "/", "")));
// where the file reside in the META-INF/... directory
FileUtils.forceMkdir(metaInfDir);
FileUtils.copyInputStreamToFile(zip.getInputStream(entry), new File(metaInfDir,
FilenameUtils.getName(entry.getName())));
log.info("Imported META-INF for project [" + aProject.getName() + "] with id ["
+ aProject.getId() + "]");
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.inception.app/inception-ui-core
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new IOException("Invalid ZIP file");
代码示例来源:origin: webanno/webanno
ZipUtils.zipFolder(exportTempDir, projectZipFile);
代码示例来源:origin: webanno/webanno
/**
* While exporting annotation documents, some of the writers generate multiple outputs, e.g. a
* type system file in addition to the annotation data. This method generates a zip file if the
* exported file do contain multiple file output
*
* @param srcFolder source folder.
* @param destZipFile target folder.
* @throws IOException if an I/O error occurs.
*/
public static void zipFolder(File srcFolder, File destZipFile)
throws IOException
{
ZipOutputStream zip = null;
try {
zip = new ZipOutputStream(new FileOutputStream(destZipFile));
for (File file : srcFolder.getAbsoluteFile().listFiles()) {
addToZip(zip, srcFolder.getAbsoluteFile(), file);
}
zip.flush();
}
finally {
closeQuietly(zip);
}
}
代码示例来源:origin: webanno/webanno
/**
* copy project log files from the exported project
* @param zip the ZIP file.
* @param aProject the project.
* @throws IOException if an I/O error occurs.
*/
@SuppressWarnings("rawtypes")
@Deprecated
private void createProjectLog(ZipFile zip, Project aProject)
throws IOException
{
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
ZipEntry entry = (ZipEntry) zipEnumerate.nextElement();
// Strip leading "/" that we had in ZIP files prior to 2.0.8 (bug #985)
String entryName = ZipUtils.normalizeEntryName(entry);
if (entryName.startsWith(LOG_FOLDER + "/")) {
FileUtils.copyInputStreamToFile(zip.getInputStream(entry),
getProjectLogFile(aProject));
log.info("Imported log for project [" + aProject.getName() + "] with id ["
+ aProject.getId() + "]");
}
}
}
代码示例来源:origin: inception-project/inception
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new IOException("Invalid ZIP file");
代码示例来源:origin: webanno/webanno
ExportUtil.exportCuratedDocuments(documentService, importExportService,
ProjectExportForm.this.getModelObject(), exportTempDir, false);
ZipUtils.zipFolder(exportTempDir, new File(
exportTempDir.getAbsolutePath() + ".zip"));
exportFile = new File(exportTempDir.getAbsolutePath()
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-project
String entryName = ZipUtils.normalizeEntryName(entry);
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new IOException("Invalid ZIP file");
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-ui-project
ExportUtil.exportCuratedDocuments(documentService, importExportService,
ProjectExportForm.this.getModelObject(), exportTempDir, false);
ZipUtils.zipFolder(exportTempDir, new File(
exportTempDir.getAbsolutePath() + ".zip"));
exportFile = new File(exportTempDir.getAbsolutePath()
代码示例来源:origin: webanno/webanno
String entryName = ZipUtils.normalizeEntryName(entry);
代码示例来源:origin: webanno/webanno
OutputStream os = new FileOutputStream(tempFile);
) {
if (!ZipUtils.isZipStream(is)) {
throw new IOException("Invalid ZIP file");
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-api-dao
exportFile = new File(exportTempDir.getAbsolutePath() + ".zip");
try {
ZipUtils.zipFolder(exportTempDir, exportFile);
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-project
/**
* copy Project META_INF from the exported project
* @param zip the ZIP file.
* @param aProject the project.
* @throws IOException if an I/O error occurs.
*/
@Deprecated
@SuppressWarnings("rawtypes")
private void createProjectMetaInf(ZipFile zip, Project aProject)
throws IOException
{
for (Enumeration zipEnumerate = zip.entries(); zipEnumerate.hasMoreElements();) {
ZipEntry entry = (ZipEntry) zipEnumerate.nextElement();
// Strip leading "/" that we had in ZIP files prior to 2.0.8 (bug #985)
String entryName = ZipUtils.normalizeEntryName(entry);
if (entryName.startsWith(META_INF_FOLDER + "/")) {
File metaInfDir = new File(getMetaInfFolder(aProject),
FilenameUtils.getPath(entry.getName().replace(META_INF_FOLDER + "/", "")));
// where the file reside in the META-INF/... directory
FileUtils.forceMkdir(metaInfDir);
FileUtils.copyInputStreamToFile(zip.getInputStream(entry), new File(metaInfDir,
FilenameUtils.getName(entry.getName())));
log.info("Imported META-INF for project [" + aProject.getName() + "] with id ["
+ aProject.getId() + "]");
}
}
}
代码示例来源:origin: de.tudarmstadt.ukp.clarin.webanno/webanno-remote
if (!ZipUtils.isZipStream(is)) {
return ResponseEntity.badRequest().body("Invalid ZIP file");
我收到多行错误,指出它有重复的类 Duplicate class android.support.v4.accessibilityservice.AccessibilityServiceInfoCom
我的项目昨天运行良好,今天却出现以下错误。请帮忙。 出了什么问题:无法解析配置“:app:debugCompileClasspath”的所有文件。 Could not find support-v4.
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我正在使用 react-native-webrtc 运行示例应用程序模块。我正在尝试在 android 中运行该应用程序,但出现这样的错误... * What went wrong: A probl
错误:配置项目“:app”时出现问题。 Could not find support-v4.jar (com.android.support:support-v4:24.0.0). Searched
我克隆了我的项目并使用 Android studio 打开,但构建失败并出现以下错误并且同一个项目在其他项目上运行良好。 出了什么问题:无法解析配置“:app:flavorUnsignedReleas
我正在运行示例应用程序......我正在使用 this模块.....但是我收到这样的错误... FAILURE: Build failed with an exception. * What went
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
我有一个 Ionic 项目,在升级到 OSx Mojave 后,出于某种原因不再构建。 该项目基于 Ionic 3 构建。 我有 Cordova CLI 7.0.0 当我运行时 ionic cordo
添加 Android 平台(ionic cordova platform add android)后,我构建了我的 Ionic 项目(ionic cordova build android),但出现错
这个问题在这里已经有了答案: Manifest merger failed : Attribute application@appComponentFactory - Androidx (14 个答
关于我的 Gradle 文件中的以下“complie”: dependencies { compile 'com.android.support:support-v4:25.3.1' }
有些困惑。 我想更频繁地使用@supports 但是...我不关心浏览器如何看待它。希望您能说清楚,如果可以的话谢谢您。 如果浏览器本身不理解@supports,它如何计算@support 'not'
我刚刚升级到 Dart 2 和最新版本的 Flutter,现在我无法构建我的应用程序。我在互联网上环顾四周,但仍然不明白为什么会发生这种情况。 我得到的错误是: FAILURE: Build fail
我正在学习 Firebase,但由于以下错误而陷入困境: Error:Failed to resolve: com.android.support:customtabs:25.4.0 Error:Fa
我在构建本周时出于某种原因尝试使用Cordova进行项目时遇到问题: cordova build android gradle获取com.android.support:support alpha而不
对应的androidx是什么com.android.support:support-compat 的图书馆实现push notifications ? 他们说here它是 androidx 的一部分,
我正在尝试为我的应用设置插桩单元测试。并且我已根据以下开发者站点链接添加了依赖项。 https://developer.android.com/training/testing/unit-testin
当我想使用 Proguard 规则生成签名的 APK(发布)时,我收到了以下错误消息: Cannot find a version of 'com.android.support:support-an
这个问题在这里已经有了答案: Failed to resolve: com.android.support:appcompat-v7:26.0.0 (14 个答案) Failed to resolv
我是一名优秀的程序员,十分优秀!