borisbrodski / sevenzipjbinding

7-Zip-JBinding
http://sevenzipjbind.sourceforge.net/
Other
176 stars 50 forks source link

wrong error output if temp directory does not exist. #43

Open sdemunck opened 3 years ago

sdemunck commented 3 years ago

Hi,

I changed the temp dir using -Djava.io.tmpdir. Afterwards, I get this error message: "Error loading SevenZipJBinding native library into JVM: invalid tmp directory 'null' [You may also try different SevenZipJBinding initialization methods 'net.sf.sevenzipjbinding.SevenZip.init*()' in order to solve this problem]"

The system property contains a valid temp dir. In net.sf.sevenzipjbinding.SevenZip.createOrVerifyTmpDir(SevenZip.java:507), I noticed the following line:

if (!tmpDirFile.exists() || !tmpDirFile.isDirectory()) {
            throwInitException("invalid tmp directory '" + tmpDirectory + "'");
}

I think this should be:

if (!tmpDirFile.exists() || !tmpDirFile.isDirectory()) {
            throwInitException("invalid tmp directory '" + tmpDirFile + "'");
}

Kind Regards, Silas

borisbrodski commented 3 years ago

Thank you for letting me know. I will fix it in the upcoming release 👍