paddybyers / anode

Android framework for node.js applications
Other
583 stars 80 forks source link

TarExtractor not handling directories correctly? #20

Open feichh opened 11 years ago

feichh commented 11 years ago

Im trying to use the action "org.meshpoint.anode.INSTALL", I noticed the org.meshpoint.anode.util.TarExtractor does not deal with directories corretly. My temp solution for this is as follows (~l.60f): if (entry.isDirectory()) { entryFile.mkdir(); } else { FileOutputStream fos = new FileOutputStream(entryFile); BufferedOutputStream bos = new BufferedOutputStream(fos); while ((count = tis.read(buf)) != -1) { bos.write(buf, 0, count); } bos.flush(); bos.close(); }

Maybe you want to take a look at this.

cheers

paddybyers commented 11 years ago

OK, well spotted - do you want to do a pull request?

Thanks

feichh commented 11 years ago

sure, as soon as I feel confident that it works correctly. I have an additional issue with "././@LongLink" entries as well.

cheers

feichh commented 11 years ago

so it seems jtar does not support all possible formats: https://github.com/kamranzafar/jtar/issues/6 hopefully jtar will add support. I send you a pull request with my current fix. see, whether you can use it.

cheers, thx