| 75 | } |
| 76 | |
| 77 | public static void deleteOrThrow(File file) throws IOException { |
| 78 | final File folder = file.getParentFile(); |
| 79 | // We need write permission on parent folder to delete the file |
| 80 | if (folder != null && !folder.canWrite() && !folder.setWritable(true)) { |
| 81 | LogUtil.e(TAG, "Enable write permission failed: " + folder); |
| 82 | } |
| 83 | |
| 84 | if (!file.delete() && file.exists()) { |
| 85 | throw new IOException("Could not delete file " + file); |
| 86 | } |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Return an list of ABIs we supported on this device ordered according to preference. Use a |