private final static LinkDigest getChainHead(Archive archive, String chainId, boolean silent) throws IOException {
        LinkDigest chainHead = LinkDigest.NULL_DIGEST;
        try {
            chainHead = new LinkDigest(chainId);
        } catch (IllegalArgumentException notAHash) {
        }

        if (chainHead.isNullDigest()) {
            try {
                FileManifest current = FileManifest.fromArchiveRootObject(archive);
                chainHead = current.getChainHeadDigest(chainId);
                if (!silent) {
                    sOut.println("Looked up chain digest from FileManifest: " + chainHead);
                }
            } catch (IOException notAFileName) {
            }
        }

        if (chainHead.isNullDigest()) {
            try {
                chainHead = archive.getRootObject(Integer.parseInt(chainId));
                if (!silent) {
                    sOut.println("Looked up as a RootObject ordinal: " + chainHead);
                }
            } catch (NumberFormatException notANumber) {
            }
        }

        if (chainHead.isNullDigest()) {
            sOut.println("Try a 20 digit hex string a file name from the FileManifest or a RootObject kind number.");
        }
        return chainHead;
    }