thrau / jarchivelib

A simple archiving and compression library for Java
https://github.com/thrau/jarchivelib
Apache License 2.0
198 stars 36 forks source link

tar.gz decompression fails if folder name contains spaces #84

Open Airneyt opened 3 years ago

Airneyt commented 3 years ago

Hello, I'm currently working with your lib and I must say I love it, it is really easy to use. Unfortunately, I've found that if one of my folder inside the .gz archive contains spaces inside its name, it fails. Here's the error :

Exception in thread "main" java.io.FileNotFoundException: C:\Users\c82rmun\Documents\Infra_SUD_tomcat_MSA_13_LogsGedWkf_2021-03-16\.\GDG49A0_GDGDDESUPDOC  \GDG49A0_GDGDDESUPDOC  .13.01.log (Le chemin d’accès spécifié est introuvable)
    at java.base/java.io.FileOutputStream.open0(Native Method)
    at java.base/java.io.FileOutputStream.open(FileOutputStream.java:291)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:234)
    at java.base/java.io.FileOutputStream.<init>(FileOutputStream.java:184)
    at org.rauschig.jarchivelib.IOUtils.copy(IOUtils.java:50)
    at org.rauschig.jarchivelib.CommonsArchiver.extract(CommonsArchiver.java:83)
    at org.rauschig.jarchivelib.ArchiverCompressorDecorator.extract(ArchiverCompressorDecorator.java:74)
    at Main.main(Main.java:64)

If you have any idea of how to fix this, i'd be thankful ! Thank you in advance