class Validator {

    public static void validate(File[] manifestFiles) throws IOException {
        final String msg = "Cannot create document from manifest XML file";
        Document[] manifests = new Document[manifestFiles.length];
        try {
            for (int i = 0; i < manifestFiles.length; i++) {
                manifests[i] = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(manifestFiles[i]);
            }
        } catch (SAXException | ParserConfigurationException e) {
            throw new IOException(MessageFormat.format("{0}: {1}", msg, e.getMessage()));
        }
        try {
            validateOrbitReference(manifests);
            validateAdjacency(manifests);
        } catch (PDUStitchingException e) {
            throw new IOException(e.getMessage());
        }
    }

}