(File toDelete)
| 88 | } |
| 89 | |
| 90 | public static boolean delete(File toDelete) { |
| 91 | boolean deleted = true; |
| 92 | |
| 93 | if (toDelete.isDirectory()) { |
| 94 | File[] children = toDelete.listFiles(); |
| 95 | if (children != null) { |
| 96 | for (File child : children) { |
| 97 | deleted &= child.canWrite() && delete(child); |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | return deleted && toDelete.canWrite() && toDelete.delete(); |
| 103 | } |
| 104 | |
| 105 | public static void copy(File from, File to) throws IOException { |
| 106 | if (!from.exists()) { |