This is an automated email from the ASF dual-hosted git repository.

shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git


The following commit(s) were added to refs/heads/master by this push:
     new 1cf2322  KYLIN-3770 ZipFileUtils is not compatible CubeMetaIngester
1cf2322 is described below

commit 1cf232289a663304f770421c7f909314064baeb5
Author: Temple Zhou <dba...@gmail.com>
AuthorDate: Wed Jan 16 15:54:34 2019 +0800

    KYLIN-3770 ZipFileUtils is not compatible CubeMetaIngester
---
 .../java/org/apache/kylin/tool/AbstractInfoExtractor.java    | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git 
a/tool/src/main/java/org/apache/kylin/tool/AbstractInfoExtractor.java 
b/tool/src/main/java/org/apache/kylin/tool/AbstractInfoExtractor.java
index 3797512..994e4d6 100644
--- a/tool/src/main/java/org/apache/kylin/tool/AbstractInfoExtractor.java
+++ b/tool/src/main/java/org/apache/kylin/tool/AbstractInfoExtractor.java
@@ -119,6 +119,18 @@ public abstract class AbstractInfoExtractor extends 
AbstractApplication {
         // compress to zip package
         if (shouldCompress) {
             File tempZipFile = File.createTempFile(packageType + "_", ".zip");
+            File tempZipDir = new File(exportDest + packageName + "/");
+            FileUtils.forceMkdir(tempZipDir);
+            for (File file : exportDir.listFiles()) {
+                if 
(file.getAbsolutePath().equals(tempZipDir.getAbsolutePath())) {
+                    continue;
+                }
+                if (file.isDirectory()) {
+                    FileUtils.moveDirectoryToDirectory(file, tempZipDir, 
false);
+                } else {
+                    FileUtils.moveFileToDirectory(file, tempZipDir, false);
+                }
+            }
             ZipFileUtils.compressZipFile(exportDir.getAbsolutePath(), 
tempZipFile.getAbsolutePath());
             FileUtils.cleanDirectory(exportDir);
 

Reply via email to