private void deleteFiles(TaskMonitor monitor) throws CancelledException {

		long start = System.currentTimeMillis();

		try {
			monitor.initialize(filesToDelete.size());
			monitor.setMessage("Deleting files...");

			List<DomainFile> snapshot = new ArrayList<>(filesToDelete.keySet());
			for (DomainFile file : snapshot) {
				monitor.checkCancelled();
				try {
					if (file.isReadOnly() && !readOnlyOverride.contains(file)) {
						// shouldn't happen normally because pre-process filters these out
						throw new IOException("File is marked read-only");
					}
					long len = file.length();
					file.delete();
					fileBytesDeleted += len;
				}
				catch (IOException e) {
					if (e instanceof RemoteException) {
						Msg.showError(this, null, "Delete File Failed", e.getMessage(), e);
					}
					filesToDelete.put(file, e.getMessage());
					erroredFileCount++;
				}
			}
		}
		finally {
			long end = System.currentTimeMillis();
			elapsedTime += (end - start);
		}
	}
Attempts to delete the files listed in {@link #filesToDelete}.
<p>
Errors are saved into {@link #filesToDelete} as the value that the file maps to.

@param monitor
@throws CancelledException
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/projectdata/actions/ProjectDataDeleteTask.java