@Override
	public void delete(int version, String user) throws IOException {
		if (fileSystem.isReadOnly()) {
			throw new ReadOnlyException();
		}
		synchronized (fileSystem) {
			String parentPath = getParentPath();
			String name = getName();
			boolean deleted = false;
			int currentVersion = getCurrentVersion();
			if (version == -1) {
				if (isVersioned) {
					checkInUse();
				}
				deleteContent(user);
				deleted = true;
			}
			else if (!isVersioned) {
				throw new IllegalArgumentException(
					"delete version must be -1 for non-versioned items");
			}
			else {
				int minVersion = getMinimumVersion();
				if (version == minVersion) {
					checkInUse(version);
					if (minVersion == currentVersion) {
						deleteContent(user);
						deleted = true;
					}
					else {
						deleteMinimumVersion(user);
					}
				}
				else if (version == currentVersion) {
					checkInUse(version);
					deleteCurrentVersion(user);
				}
				else {
					throw new IOException("Only the oldest or latest version may be deleted");
				}
			}

			if (deleted) {
				fileSystem.itemDeleted(parentPath, name); // de-allocates index entry
				if (currentVersion > 0) {
					// Only notify if initial version was created
					fileSystem.getListener().itemDeleted(parentPath, name);
				}
				fileSystem.deleteEmptyVersionedFolders(getParentPath());
			}
			else {
				fireItemChanged();
			}
		}
	}
@see ghidra.framework.store.FolderItem#delete(int, java.lang.String)
Ghidra/Framework/FileSystem/src/main/java/ghidra/framework/store/local/LocalFolderItem.java