return 0;\r
}\r
\r
+ /**\r
+ * Delete a file or recursively delete a folder.\r
+ *\r
+ * @param fileOrFolder\r
+ * @return true, if successful\r
+ */\r
+ public static boolean delete(File fileOrFolder) {\r
+ boolean success = false;\r
+ if (fileOrFolder.isDirectory()) {\r
+ File [] files = fileOrFolder.listFiles();\r
+ if (files != null) {\r
+ for (File file : files) {\r
+ if (file.isDirectory()) {\r
+ success |= delete(file);\r
+ } else {\r
+ success |= file.delete();\r
+ }\r
+ }\r
+ }\r
+ }\r
+ success |= fileOrFolder.delete();\r
+ return success;\r
+ }\r
+\r
/**\r
* Copies a file or folder (recursively) to a destination folder.\r
* \r