public static boolean lockArchive(FileArchive archive) {
		try {
			archive.acquireWriteLock();
			return true;
		}
		catch (ReadOnlyException e) {
			Msg.showError(log, null, "Unable to Lock Archive for Writing", e.getMessage());
		}
		catch (LockException exc) {
			Msg.showError(log, null, "Unable to Lock Archive for Writing",
				"Unable to obtain lock for archive: " + archive.getName() + "\n" +
					exc.getMessage());
		}
		catch (IOException ioe) {
			Throwable cause = ioe.getCause();
			if (cause == null) {
				cause = ioe;
			}
			Msg.showError(log, null, "Unable to Lock Archive for Writing",
				"Problem attempting to open archive for update: " + archive.getName() + "\n" +
					cause.getMessage());
		}
		return false;
	}
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