how can i remove the path from zip file
<p>I have a zip file that has a path. When I unzip the file and put it in my target folder, it then creates folders of the path.</p>

<pre><code>public boolean doZip(String fileName, String zipfilename) {

    boolean zipStatus = true;

    try {
        String[] filesToZipP = new String[1];
        filesToZipP[0] = fileName;
        byte[] buffer = new byte[1000];
        ZipOutputStream out =
            new ZipOutputStream(new FileOutputStream(zipfilename));

        out.setLevel(Deflater.DEFAULT_COMPRESSION);

        for (int i = 0; i &lt; filesToZipP.length; i++) {
            FileInputStream in = new FileInputStream(filesToZipP[i]);
            out.putNextEntry(new ZipEntry(filesToZipP[i]));

            int len;
            while ((len = in.read(buffer)) &gt; 0) {
                out.write(buffer, 0, len);
            }
            out.closeEntry();
            in.close();
        }
        out.close();
    }
    catch (IllegalArgumentException e) {
        zipStatus = false;

    }
    return zipStatus;
}
</code></pre>
