UnZip folder to Program File folder using Java
<p>I'm currently trying to create a <code>Java</code> program that will unzip a folder into a certain folder within the <code>Program Files</code> Folder.</p>

<p>I'm using the 3rd party library <code>Zip4j</code> to unzip the folder. the following is the code i'm using. </p>

<pre><code>    String source = "C:\\Users\\chris\\Desktop\\New folder.zip";
    String destination = "C:\\Program Files (x86)\\Test Folder";
    String password = "password";

    try {
        ZipFile zipFile = new ZipFile(source);
        if (zipFile.isEncrypted()) {
            zipFile.setPassword(password);
        }
        zipFile.extractAll(destination);
    } catch (ZipException e) {
        e.printStackTrace();
    }
</code></pre>

<p>it works perfectly if I'm trying to unzip to a normal folder on the desktop. but once i try to unzip it to the program files i get the following <code>Exception java.io.FileNotFoundException</code>.</p>

<p>I assume that my program needs admin rights to be able access the folder within the <code>Program Files</code> folder. Does anyone know how to do this?</p>

<p>Error log:</p>

<pre><code>Caused by: java.io.FileNotFoundException: C:\Program Files (x86)\Test     Folder\New folder\New Text Document.txt (The system cannot find the path specified) at java.io.FileOutputStream.open0(Native Method) at java.io.FileOutputStream.open(FileOutputStream.java:270) at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:213) at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:162) at net.lingala.zip4j.unzip.UnzipEngine.getOutputStream(UnzipEngine.java:432) ... 7 more
</code></pre>