| 292 | } |
| 293 | |
| 294 | Future<Void> BackupContainerLocalDirectory::deleteContainer(int* pNumDeleted) { |
| 295 | // In order to avoid deleting some random directory due to user error, first describe the backup |
| 296 | // and make sure it has something in it. |
| 297 | return map(describeBackup(false, invalidVersion), [=](BackupDescription const& desc) { |
| 298 | // If the backup has no snapshots and no logs then it's probably not a valid backup |
| 299 | if (desc.snapshots.size() == 0 && !desc.minLogBegin.present()) |
| 300 | throw backup_invalid_url(); |
| 301 | |
| 302 | int count = platform::eraseDirectoryRecursive(m_path); |
| 303 | if (pNumDeleted != nullptr) |
| 304 | *pNumDeleted = count; |
| 305 | |
| 306 | return Void(); |
| 307 | }); |
| 308 | } |
nothing calls this directly
no test coverage detected