unzip

Azure, Java: Read and Unzip a file which is saved in Azure Storage (Blobs) and encoded by Avro

你。 提交于 2019-12-13 04:02:25
问题 I have a file in Azure Storage which is zipped and then encoded by Avro as Blob. I read it and decode it as you see in the following code: public static int decodeAvroFile(String avroFile) throws Exception { GenericDatumReader<Object> reader=new GenericDatumReader<Object>(); org.apache.avro.file.FileReader<Object> fileReader= DataFileReader.openReader(new File(avroFile),reader); ByteArrayOutputStream os = new ByteArrayOutputStream(); try { Schema schema=fileReader.getSchema(); DatumWriter

how to unzip uploaded zip file?

帅比萌擦擦* 提交于 2019-12-13 03:56:29
问题 I am trying to upload a zipped file using codeigniter framework with following code function do_upload() { $name=time(); $config['upload_path'] = './uploadedModules/'; $config['allowed_types'] = 'zip|rar'; $this->load->library('upload', $config); if ( ! $this->upload->do_upload()) { $error = array('error' => $this->upload->display_errors()); $this->load->view('upload_view', $error); } else { $data = array('upload_data' => $this->upload->data()); $this->load->library('unzip'); // Optional:

Problem when Unzipping

走远了吗. 提交于 2019-12-13 03:53:28
问题 Hey, I'm trying to unzip a file using this class: public class Decompress { private String _zipFile; private String _location; public Decompress(String zipFile, String location) { _zipFile = zipFile; _location = location; _dirChecker(""); } public void unzip() { try { FileInputStream fin = new FileInputStream(_zipFile); ZipInputStream zin = new ZipInputStream(fin); ZipEntry ze = null; while ((ze = zin.getNextEntry()) != null) { Log.v("Decompress", "Unzipping " + ze.getName()); if(ze

ZipFile.CreateFromDirectory does not include directory entries

为君一笑 提交于 2019-12-13 02:48:17
问题 I have a basic Windows 10 UWP app and use the following code to create a .zip file from a directory structure: ZipFile.CreateFromDirectory("/inputpath", "/output.zip"); I noticed that the resulting .zip file does not have any entries for nested directories, thus unzipping on a Mac does not work. Here is the directory structure that I want to include in the zip file: ./ziproot ./Data Version.txt What I get using the API ZipFile.CreateFromDirectory(...) : $ zipinfo output.zip Archive: output

I need to extract .tar.Z file using java [duplicate]

試著忘記壹切 提交于 2019-12-13 02:45:51
问题 This question already has answers here : Read a .Z file (unix compresses file) in Java (2 answers) Closed 2 years ago . Do anyone have coding in java to extract .tar.Z files. Assume that i am having file called home.tar.Z I need extract this file using java code, can you give any sample code. Thanks 回答1: The .Z extension is not the gzip extension, it is from compress . You can launch shell scripts from Java, I'd do it like that, since I don't know any compress library for Java. For tar/gz you

Java: Maintaining zipped files Modified Date

a 夏天 提交于 2019-12-12 20:09:06
问题 A proprietary program that I'm working with zips up and extracts certain files without changing the modified date of the files when unzipping. I'm also creating my own zip and extraction tool based off the source code in our program but when I'm unzipping the files the modified date of all zipped files is showing with the unzip time & date. Here's the code for my extraction: public static int unzipFiles(File zipFile, File extractDir) throws Exception { int totalFileCount = 0; String

How to unpack some files from .apk to /data/data/<package> folder while installing the .apk?

眉间皱痕 提交于 2019-12-12 19:39:57
问题 My android application needs another NATIVE application executable to run before the android one, so that they can communicate through sockets. Android application has a JNI layer for handling the client-side communication. Now i need to bundle up the native executable along with the apk file, so that when it is installed on a device it gets unzipped into either the phone memory or the memory card. How do i do this? I tried keeping the native executable in res/asset and in res/raw folders,

Removing path from a zip file using python

邮差的信 提交于 2019-12-12 14:22:44
问题 I have a zip file that has a path. When I unzip the file using python and put it in my target folder, it then creates all of the files in the path inside my target folder. Target: d:\unzip_files zip file has a path and file name of: \NIS\TEST\Files\tnt.png What happens: d:\unzip_files\NIS\TEST\Files\tnt.png Is there a way to hae it just unzip the tnt.png file into d:\unzip_files? Or will I have to read down the list and move the file and then delete all of the empty folders? import os, sys,

linux解压zip、bz、bz2、z、gz、tar(解包)

℡╲_俬逩灬. 提交于 2019-12-12 12:16:40
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> zip: 压缩: zip [-AcdDfFghjJKlLmoqrSTuvVwXyz$][-b <工作目录>][-ll][-n <字尾字符串>][-t <日期时间>][-<压缩效率>][压缩文件][文件...][-i <范本样式>][-x <范本样式>] 解压: unzip [选项] 压缩文件名.zip 选项:    -x 文件列表 解压缩文件,但不包括指定的file文件。    -v 查看压缩文件目录,但不解压。    -t 测试文件有无损坏,但不解压。    -d 目录 把压缩文件解到指定目录下。    -z 只显示压缩文件的注解。    -n 不覆盖已经存在的文件。    -o 覆盖已存在的文件且不要求用户确认。    -j 不重建文档的目录结构,把所有文件解压到同一目录下。 例子: 例1:将压缩文件text.zip在当前目录下解压缩。    $ unzip text.zip    例2:将压缩文件text.zip在指定目录/tmp下解压缩,如果已有相同的文件存在,要求unzip命令不覆盖原先的文件。    $ unzip -n text.zip -d /tmp   例3:查看压缩文件目录,但不解压。    $ unzip -v text.zip    zgrep命令  

Why my decompress class don't make directories?

眉间皱痕 提交于 2019-12-12 05:02:08
问题 I have a class to decompress files, it works fine when the zip doesn't have any folder inside. If it does then it just throw errors. Hers my class: public class Decompress { private String _zipFile; private String _location; ZipEntry ze = null; public Decompress(String zipFile, String location) { _zipFile = zipFile; _location = location; _dirChecker(""); } public void unzip() { try { FileInputStream fin = new FileInputStream(_zipFile); ZipInputStream zin = new ZipInputStream(fin); while ((ze