static File getFile(Component component, FileArchive archive) {
		ArchiveFileChooser fileChooser = new ArchiveFileChooser(component);
		String archiveName = archive.getName();
		File file = fileChooser.promptUserForFile(archiveName);
		fileChooser.dispose();
		if (file == null) {
			return null;
		}
		if (file.equals(archive.getFile().getFile(false))) {
			return file;
		}

		if (archive.getArchiveManager().isInUse(file)) {
			Msg.showInfo(ArchiveUtils.class, component, "Cannot Perform Save As",
				"Cannot save archive to " + file.getName() + "\nbecause " + file.getName() +
					" is in use.");
			return null;
		}

		if (file.exists()) {
			if (OptionDialog.showYesNoDialogWithNoAsDefaultButton(component,
				"Overwrite Existing File?", "Do you want to overwrite existing file\n" +
					file.getAbsolutePath()) != OptionDialog.OPTION_ONE) {
				return null;
			}

			if (!deleteArchiveFile(file)) {
				Msg.showError(log, component, "Error Deleting File",
					"Could not delete file " + file.getAbsolutePath());

				return null;
			}
		}

		return file;
	}
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