public static boolean canClose(Archive archive, Component component) {
		if (!archive.isChanged()) {
			return true;
		}
		int result =
			OptionDialog.showYesNoCancelDialog(component, "Save Archive?", "Datatype Archive \"" +
				archive.getName() + "\" has been changed.\n Do you want to save the changes?");

		if (result == OptionDialog.CANCEL_OPTION) {
			return false;
		}
		if (result == OptionDialog.NO_OPTION) {
			if (archive instanceof FileArchive) {
				// Release the write lock without saving. Returns file archive to its unedited state.
				try {
					((FileArchive) archive).releaseWriteLock();
				}
				catch (IOException e) {
					Msg.showError(log, component, "Unable to release File Archive write lock.",
						e.getMessage(), e);
					return false;
				}
			}
			return true;
		}

		return saveArchive(archive, component);
	}
This method will perform a save on the given archive.  However, the one caveat is that if
the archive has never been saved, then a filename needs to be chosen.  Under this 'special'
condition this method logically turns into a {@link #saveAs(Component, FileArchive)}.

@param component The component over which GUI message will be shown when required.
@param archive The archive to save.
@throws DuplicateFileException thrown only in the {@link #saveAs(Component, FileArchive)}
		   condition in the case of a naming conflict.
@throws IOException If the sky is falling.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/datamgr/archive/ArchiveUtils.java