URGENTTT...zip folders in java
i have written a code whihc recursively zips the folders and subfolders in a directory but the directory structure in not retained in the .zip folder..i.e when i open it there are files but not folders(whereas in .rar this problem is not there).
and also the code zips the folder passed in the command line argument but it is showing errors for some paths
consider java and jack n jill are two folders.
it works fine for
java Zipjunu c:\java
but it shows error for
java Zipjunu c:\jack n jill
it gives FileNotFoundException c:\jack
here is the code snippet for that :
File file=new File(fileName);
zos=new ZipOutputStream(new FileOutputStream(file+".zip"));
System.out.println("file path:" +file.getAbsolutePath());