1

I have folder with many symlinks in there and I need to zip/unzip them in way that all links will be saved.

Can any Java ZIP library make this ? Maybe libraries have special configurations for this ?

  • Symbolic link is just file in special format, so it should be zipped as regular file. Do you have any specific problem with that? – AlexR Dec 23 '15 at 11:52
  • When i try to zip them as ussual they transforms to regular file without saving link. – Stepanov Roman Dec 23 '15 at 11:54
  • How do you create your zip? Are you using zip utility? – AlexR Dec 23 '15 at 11:56
  • I've tried java.util.zip, true zip and zip4j – Stepanov Roman Dec 23 '15 at 11:58
  • Let's do a step back. Create file hello.txt and link in the same folder. Then create zip of this folder using command line utility. Do you see both file and link into your zip? – AlexR Dec 23 '15 at 12:00
  • If I use just "zip target.zip sourceDir" then no, but if I use "zip --recurse-paths --symlinks target.zip sourceDir" then yes – Stepanov Roman Dec 23 '15 at 12:19
  • Cool. Now please try to do the same using java code and if it does not work your code. Unfortunately I cannot run anything on Linux right now but I believe that you are doing something wrong there. – AlexR Dec 23 '15 at 12:23
  • Seems like my code does same thing as ussual zipping without parameters. – Stepanov Roman Dec 23 '15 at 12:40

0 Answers0