Questions tagged [zipinputstream]

A mechanism for reading zip-compressed data from a stream

A ZipInputStream is a mechanism for reading data from a stream, where the data is in a zip-compressed format. A stream is usually comprised of data being read from a local file, or data being transmitted from a remote server over a network protocol such as HTTP or FTP. As the data is read from the stream, the ZipInputStream decompresses it, and returns the uncompressed data to the application.

164 questions
0
votes
1 answer

Java ZipInputStream throws zip.ZipException: invalid distance too far back while parsing nested zip files

I'll start of with acknowledgment that I've read several threads here and on the internet and my problem persists and seems to be something different. I have a zip file which contains several .txt files, directories, subdirectories to this…
Macryo
  • 188
  • 2
  • 12
0
votes
2 answers

How to user Scanner check if a Zip file compressed by CSV or other type of files in JAVA?

I am trying to use Scanner read ZipInputStream line by line, below is the code i have ZipInputStream inputStream = new ZipInputStream(bodyPartEntity.getInputStream()); inputStream.getNextEntry(); …
kang
  • 17
  • 3
0
votes
1 answer

Question about reading from a ZipInputStream/ZipEntry in java

Scenario: I have code that calls a soap web service, gets an attachment which is a zip file. Then unzips it, goes through all the files, gets the one file I want, which is a csv file, and gets the content of the csv file: public static void…
mchl45
  • 29
  • 6
0
votes
1 answer

How to convert byte array to ZipOutputStream in spring MVC?

Trying to read a zip file stored in a database as a byte array. .zip is getting downloaded using the following code but the size of files included in the zip is none. No data is there. I already went through lots of answers but not sure what's…
Amol Patil
  • 985
  • 2
  • 11
  • 43
0
votes
0 answers

ZipInputStream conversion

i have a java service that take a byte array in order to convert it in one or more pdf files or jpg files. i know this service work because it's called from another java system that correctly send files with no problems. now i need to call this…
nonlso
  • 1
  • 1
0
votes
1 answer

[JAVA]Alternatives to ZipInputStream thread safe

I have some concurrency problems with ZipInputStream and I found that it is not safe thread. Do you know any alternative which is threaded safe? Thank you
0
votes
1 answer

Add Inner Zip entries to zip file

I want somehow to add files into inner zip entry. Following structure of zip file looks like this: input-zip-file |-- directory/ | |-- zipfile.zip - | | |-- files.txt - *How can i get these entries to my zipfile.zip* | | |--…
0
votes
0 answers

Indicating that a ZIP file is corrupted/illegal in Java

Currently, when trying to read a ZIP file, I cannot differentiate between an empty ZIP file and a corrupted/illegal ZIP file, as in both cases, the following while loop is never going to run: ZipInputStream zis = new ZipInputStream(bais); ZipEntry…
SomethingSomething
  • 11,491
  • 17
  • 68
  • 126
0
votes
0 answers

zipInputStream.getNextEntry() always return null from stream that created from byte[]

Good day! I have soap response message that contatined binary zip file. It looks like: binary response I try to parse zip-file: byte[] bin = ExecutionUtil.getDynamicProcessProperty("binary").getBytes(); logger.warning("binary "+bin); ZipInputStream…
0
votes
1 answer

Extract a remote zip file and unzip it to a hdfs in java

What i'm doing is just unzip and upload a zip file ,which can be download from a website, on to a hdfs. And here's the code: String src="http://corpus.byu.edu/wikitext-samples/text.zip"; String dst =…
0
votes
1 answer

ZipInputStream.read in ZipEntry

I am reading zip file using ZipInputStream. Zip file has 4 csv files. Some files are written completely, some are written partially. Please help me find the issue with below code. Is there any limit on reading buffer from ZipInputStream.read…
PadmajaB
  • 13
  • 2
0
votes
0 answers

Is there a way to convert a full ZipInputStream into a single InputStream to save it as a zip file on disk

This is something to do with the AEM Translation API, the TranslationObject can give us a context package as a ZipStreamInput, we need to take that input and either convert to a Base64 String to send as part of an XML, or a way to convert to an…
0
votes
2 answers

What is the best way to check if a FileInputStream is closed?

So I have this FileInputStream that is required to create a ZipInputStream and I want to know what happens to the ZipInputStream if the FileInputStream is closed. Consider the following code: public void Foo(File zip) throws ZipException{ …
0
votes
2 answers

zip files with jackrabbit

I'm trying make upload for jackrabbit but the zip file download is corrupted The maven dependencies: org.apache.jackrabbit jackrabbit-jcr2dav
aliel
  • 157
  • 1
  • 2
  • 8
0
votes
0 answers

ZipInputStream getNextEntry() Returns Null after Android 6.x update

I had working unzip code that uses ZipInputStream to unzip a large zip file from an InputStream. I have tested with some sample ZIP files on Android 5.1.1. I recently updated my development Galaxy S5 to Android 6.0.1. The same code is no longer…