* if the war is in the process of updating.
*/
private boolean commitArchive()
throws IOException
{
Path archivePath = getArchivePath();
if (archivePath == null)
return true;
if (! archivePath.canRead())
return true;
String hash = Long.toHexString(archivePath.getCrc64());
CommitBuilder commit = new CommitBuilder();
commit.stage(getAutoDeployStage());
commit.type(getIdType());
commit.tagKey(getIdKey());
String commitId = commit.getId();
RepositoryTagEntry tagEntry = _repositorySpi.getTagMap().get(commitId);
if (tagEntry != null
&& hash.equals(tagEntry.getAttributeMap().get("archive-digest"))) {
return true;
}
commit.attribute("archive-digest", hash);
commit.message(".war added to repository from "
+ archivePath.getNativePath());
if (log.isLoggable(Level.FINE))
log.fine(this + " adding archive to repository from " + archivePath);
_repository.commitArchive(commit, archivePath);