You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/04/26 01:01:23 UTC
[kylin] branch master updated: Minor, remove TarGZUtil.java
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 7e8d5a5 Minor, remove TarGZUtil.java
7e8d5a5 is described below
commit 7e8d5a573640d9b90a415ea860a4e0558ee865de
Author: shaofengshi <sh...@apache.org>
AuthorDate: Thu Apr 26 09:01:10 2018 +0800
Minor, remove TarGZUtil.java
---
.../apache/kylin/storage/hbase/util/TarGZUtil.java | 69 ----------------------
1 file changed, 69 deletions(-)
diff --git a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/TarGZUtil.java b/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/TarGZUtil.java
deleted file mode 100644
index f0c4c5b..0000000
--- a/storage-hbase/src/main/java/org/apache/kylin/storage/hbase/util/TarGZUtil.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.apache.kylin.storage.hbase.util;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.apache.commons.compress.archivers.tar.TarArchiveEntry;
-import org.apache.commons.compress.archivers.tar.TarArchiveInputStream;
-import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream;
-
-public class TarGZUtil {
-
- public static void uncompressTarGZ(File tarFile, File dest) throws IOException {
- dest.mkdir();
- TarArchiveInputStream tarIn = null;
-
- tarIn = new TarArchiveInputStream(new GzipCompressorInputStream(new BufferedInputStream(new FileInputStream(tarFile))));
-
- TarArchiveEntry tarEntry = tarIn.getNextTarEntry();
- // tarIn is a TarArchiveInputStream
- while (tarEntry != null) {// create a file with the same name as the tarEntry
- File destPath = new File(dest, tarEntry.getName());
- System.out.println("working: " + destPath.getCanonicalPath());
- if (tarEntry.isDirectory()) {
- destPath.mkdirs();
- } else {
- destPath.createNewFile();
- //byte [] btoRead = new byte[(int)tarEntry.getSize()];
- byte[] btoRead = new byte[1024];
- //FileInputStream fin
- // = new FileInputStream(destPath.getCanonicalPath());
- BufferedOutputStream bout = new BufferedOutputStream(new FileOutputStream(destPath));
- int len = 0;
-
- while ((len = tarIn.read(btoRead)) != -1) {
- bout.write(btoRead, 0, len);
- }
-
- bout.close();
- btoRead = null;
-
- }
- tarEntry = tarIn.getNextTarEntry();
- }
- tarIn.close();
- }
-
-}
--
To stop receiving notification emails like this one, please contact
shaofengshi@apache.org.