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
3
votes
1 answer

Extracting file with ZipInputStream error UTFDataFormatException

I have an error while I try to extract the files of a .zip that I have stored in my assets folder, the error appear because my file have the character ñ. The error throws when I try to get next entry: zipIs.getNextEntry() private void loadzip(String…
ƒernando Valle
  • 3,634
  • 6
  • 36
  • 58
3
votes
5 answers

How to prevent ZipInputStream from being closed by after a XSLT transform?

I have a ZipInputStream that contains a number of XML files that I want to apply a transform to. The following piece of code loads the XSLT and ZIP files and loops through the ZIP entries, attempting to apply the transform to each one. However it…
clyde
  • 33
  • 1
  • 4
2
votes
2 answers

Extract the zip and convert to base 64 of each file

I am reading the list of attachment from a system witch returns the attached document in base 64 encoded string as a zip and My objective is to get the base 64 encoded string for each attached document. Note:- I am trying below code where I am…
Upendra Singh
  • 35
  • 1
  • 5
2
votes
1 answer

Is there a way to read programmatically a .jmod file in Java?

I opened a .jmod file with 7-zip and I can see the contents. I tried to read it with ZipInputStream programmatically but it doesn't work: does someone know how to do it?
user12801918
2
votes
1 answer

Java Reading from n-nested zips, modyfing and writing to new zip preserving original structure

PROBLEM SOLVED IN EDIT 3 I've been struggling with this problem for sometime. All of the questions here in SO or internet seems to work only on 'shallow' structures with one zip inside of another. However I have zip archive which structure is more…
Macryo
  • 188
  • 2
  • 12
2
votes
0 answers

Unable to extract zip files using Java for zip64 type

I am using following function to extract zip files in Java public static List unzipFiles(File zipFile, File targetDirectory) { List files = new ArrayList(); BufferedOutputStream dest = null; FileInputStream…
DockYard
  • 989
  • 2
  • 12
  • 29
2
votes
1 answer

What's with Ruby's ZipInputStream screwing up my line endings?

I'd be happy with ZipInputStream taking indecent liberties with the line endings that are stored in a file if it would at least get them right for the platform I'm storing the file on. Unfortunately, I pull a text file (.txt, .cpp. .etc.) out of a…
Sniggerfardimungus
  • 11,583
  • 10
  • 52
  • 97
2
votes
3 answers

java.io.IOException: Stream closed ZipInputStream

Below is the code Snippet. FileInputStream fin = new FileInputStream(zipFile); ZipInputStream zin = new ZipInputStream(fin); ZipEntry entry = null; String routerListUCM = ""; try { entries: while ((entry =…
Namira
  • 25
  • 1
  • 6
2
votes
0 answers

Jersey reading zipinputstream

I have written following server code : Note for lack of time I removed annotations on method but I correctly set them @Produces({ "application/xml", "application/zip", "application/octet-stream" }) public Response getFile(@PathParam("fileName")…
2
votes
1 answer

ZipInputStream Throws Illegalargument exception for diacritics

If I run the below program with the zip file which has some files with diacritic characters (e.g 1-2GF-969##JÖN.pdf) , I get IllegalArgumentException. My application has to support all languages. So, we set encoding to UTF-8 All languages work fine.…
2
votes
1 answer

How to play a single audio file from a collection of 100k audio files split into two folders?

I have placed two media folders into a single zip folder, and the total is 100k media files in the zip folder. I need to play a single file from particular folder of the zip folder. The problem is, first the total content of the Zip folder is…
2
votes
1 answer

Unzipping with ZipInputStream never finishes

I'm using an AsyncTask to unzip a file, and all seems to be going well (all the files in the ZIP archive are extracted), but my unzip method never finishes. Here's the source for my unzip class: public class MyUnzipper { public static boolean…
Magnus
  • 17,157
  • 19
  • 104
  • 189
2
votes
0 answers

Removing a jar files META-INF folder in Java

I am using the following method to filter out META-INF folder and its contents: public static void copyWithoutMetaInf(final String originalZip, final String newZip) throws IOException { final ZipInputStream zip = new ZipInputStream(new…
Hugh Macdonald
  • 143
  • 1
  • 12
2
votes
2 answers

Remove whitespaces from XML file read from a zip file

I'm reading in an XML file that's stored inside a zip file. I need to remove the whitespaces, but I nothing seems to work. Here's what I have, but trim() isn't doing anything. for (Enumeration e = zip.entries();…
user3007194
  • 111
  • 1
  • 8
2
votes
2 answers

Is there a way to read a specific file from a ZipInputStream without having to iterate over the whole entry set?

I would like to know if there is a way to read a particular file directly from a ZipFile / ZipInputStream without having to iterate over the entire entry set. I imagine this could be quite an overhead, if the archive contains a large number of…
carlspring
  • 31,231
  • 29
  • 115
  • 197
1 2
3
10 11