private static Archive createArchive(EdiSpecificationReader ediSpecificationReader, String urn, String... messages) throws IOException {
Archive archive = new Archive();
StringBuilder modelListBuilder = new StringBuilder();
StringWriter messageEntryWriter = new StringWriter();
String pathPrefix = urn.replace(".", "_").replace(":", "/");
EdiDirectory ediDirectory = ediSpecificationReader.getEdiDirectory(messages);
// Add the common model...
addModel(ediDirectory.getCommonModel(), pathPrefix, modelListBuilder, messageEntryWriter, archive);
// Add each of the messages...
for(Edimap messageModel : ediDirectory.getMessageModels()) {
addModel(messageModel, pathPrefix, modelListBuilder, messageEntryWriter, archive);
}
// Now create XML Schemas
Set<EPackage> packages = new ECoreGenerator().generatePackages(ediDirectory);