|
SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Delete a Folder in Java
Is there a way to Delete A Folder and all of it's subfolders and contents in java without having to call though every content of the folder and deleting them one at a time.
I tried Folder.delete(); but the folder contents have to be empty for that to work. TIA |
#2
|
|||
|
|||
I found this but it doesn't seem to work either not sure why seems like it would
Code:
public static void delete(File folder) { if(folder.exists()) { File[] files = folder.listFiles(); for(int nFileCur=0; nFileCur < files .length; nFileCur++) { File oFileCur = files [nFileCur]; if(oFileCur.isDirectory()) { // call itself to delete the contents of the current folder delete(oFileCur); } oFileCur.delete(); } } } |
#3
|
|||
|
|||
NeverMind Got it sorry for wasting anyones time
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageMC - Delete DVD folder | dlandrum | SageMC Custom Interface | 10 | 07-04-2009 11:50 AM |
How to delete a video folder ? | rv73 | SageTV Software | 1 | 03-26-2008 12:55 PM |
How to delete multiple recordings or set it to auto delete? | batigol9 | SageTV Software | 24 | 11-10-2006 07:57 PM |
What is the errant folder for, can i delete its contents?! | jimbobuk | SageTV Software | 1 | 05-12-2003 02:43 PM |
Beta V1.2.2 Java java.lang Null Pointer Exception | hamptonhills | SageTV Beta Test Software | 1 | 03-27-2003 12:11 PM |