private static void validateUriHashes(Archive archive,
                                          String uri,
                                          boolean allowNoParents) throws IOException {
        String[] fields = uri.split("/");
        if (fields.length != 2) {
            throw new IOException("Couldn't parse uri: " + uri);
        }
        fields = fields[1].split("_");
        if (fields.length < 1) {
            throw new IOException("Couldn't parse uri: " + uri);
        }

        String[] expected  = makeUriNamePart(archive).split("_");

        for (int index = 0; index < expected.length; index++) {
            if (index >= fields.length) {
                continue;
            }
        }

        if (fields.length == 1 && fields[0].equals(expected[0])) {
            // LATER: tighten up.
            // For now, allow old URIs that don't have parent info hashes.
            return;
        }

        if (expected.length != fields.length) {
            throw new IOException("Hash validation failed(0)! Inserter is lying about contents.");
        }

        for (int index = 0; index < expected.length; index++) {
            if (!expected[index].equals(fields[index])) {
                throw new IOException("Hash validation failed(1)! Inserter is lying about contents.");
            }
        }
    }