folder deletion
I have a problem deleting a folder....everything seems to be right,,but it doesnt work consistently,,,yeah the same code does delete the folder at times.
im attaching the code below:
[i]String path= outFilePath.substring(0,outFilePath.lastIndexOf("."));
File file=new File(path);
recursiveRemove(file);
public static void recursiveRemove(File file) {
try
{
if(file.isDirectory()) {
File[] contents = file.listFiles();
for(File temp : contents) {
recursiveRemove(temp);
}
}
System.out.println("Removed "+file+"? "+file.delete());
}
catch(Exception e)
{
System.out.println("the output error is below++++++++++++++++++++++++++++++++");
e.printStackTrace();
}
}
the first line is the place where it gives an error,but guess that code is correct as it gives the correct string when printed.
**in the first line,outputfilepath is the path to the zip file, and a folder in the same path exists with the same name,,so cutting of the ".zip " part
If ne more info is required,plz leme know...
Any help will be life saving
thnxxxx

