src/com/esotericsoftware/scar/Scar.java
static public boolean delete (String fileName) {
		if (fileName == null) throw new IllegalArgumentException("fileName cannot be null.");

		File file = new File(fileName);
		if (file.exists() && file.isDirectory()) {
			File[] files = file.listFiles();
			for (int i = 0, n = files.length; i < n; i++) {
				if (files[i].isDirectory())
					delete(files[i].getAbsolutePath());
				else {
					if (TRACE) trace("scar", "Deleting file: " + files[i]);
					files[i].delete();
				}
			}
		}
		if (TRACE) trace("scar", "Deleting file: " + file);
		return file.delete();
	}
/** Deletes a file or directory and all files and subdirecties under it. */
Deletes a file or directory and all files and subdirecties under it.
Deletes a file or directory and all files and subdirecties under it .
static public boolean delete (String fileName) {
		if (fileName == null) throw new IllegalArgumentException("fileName cannot be null.");
		File file = new File(fileName);
		if (file.exists() && file.isDirectory()) {
			File[] files = file.listFiles();
			for (int i = 0, n = files.length; i < n; i++) {
				if (files[i].isDirectory())
					delete(files[i].getAbsolutePath());
				else {
					if (TRACE) trace("scar", "Deleting file: " + files[i]);
					files[i].delete();
				}
			}
		}
		if (TRACE) trace("scar", "Deleting file: " + file);
		return file.delete();
	}
static public boolean delete ( String fileName ) { if ( fileName == null ) throw new IllegalArgumentException ( "fileName cannot be null." ) ; File file = new File ( fileName ) ; if ( file . exists ( ) && file . isDirectory ( ) ) { File [ ] files = file . listFiles ( ) ; for ( int i = 0 , n = files . length ; i < n ; i ++ ) { if ( files [ i ] . isDirectory ( ) ) delete ( files [ i ] . getAbsolutePath ( ) ) ; else { if ( TRACE ) trace ( "scar" , "Deleting file: " + files [ i ] ) ; files [ i ] . delete ( ) ; } } } if ( TRACE ) trace ( "scar" , "Deleting file: " + file ) ; return file . delete ( ) ; }
Deletes a file or directory and all files and subdirecties under it.
Deletes a file or directory and all files and subdirecties under it .