mayankshriv commented on a change in pull request #5665: URL: https://github.com/apache/incubator-pinot/pull/5665#discussion_r453103851
########## File path: pinot-common/src/main/java/org/apache/pinot/common/utils/TarGzCompressionUtils.java ########## @@ -18,225 +18,151 @@ */ package org.apache.pinot.common.utils; +import com.google.common.base.Preconditions; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.nio.file.Files; -import java.util.LinkedList; +import java.util.ArrayList; import java.util.List; -import org.apache.commons.compress.archivers.ArchiveException; -import org.apache.commons.compress.archivers.ArchiveStreamFactory; +import org.apache.commons.compress.archivers.ArchiveEntry; +import org.apache.commons.compress.archivers.ArchiveInputStream; +import org.apache.commons.compress.archivers.ArchiveOutputStream; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; import org.apache.commons.compress.archivers.tar.TarArchiveOutputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; import org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream; -import org.apache.commons.io.FileUtils; import org.apache.commons.io.IOUtils; -import org.apache.pinot.common.Utils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.commons.lang3.StringUtils; /** - * Taken from http://www.thoughtspark.org/node/53 - * + * Utility class to compress/de-compress tar.gz files. */ public class TarGzCompressionUtils { - private static final Logger LOGGER = LoggerFactory.getLogger(TarGzCompressionUtils.class); + private TarGzCompressionUtils() { + } + public static final String TAR_GZ_FILE_EXTENSION = ".tar.gz"; + private static final char ENTRY_NAME_SEPARATOR = '/'; Review comment: Is this for file separator? If so, use File.separator instead? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org