protected void doGenResources(List<JarEntryData> entries, Api api, Map<Object, Object> variablesMap) throws UnsupportedEncodingException, IOException {
if (api.getValidation() != null) {
Validation val = api.getValidation();
Schema schema = val.getSchema();
if (schema != null) {
// loop on schema resources and store them on files
StringBuffer buf = new StringBuffer();
List<ResourceItem> resources = schema.getResourcesList();
int resourcesCount = resources.size();
for (int i = 0; i < resourcesCount; i++) {
ResourceItem item = resources.get(i);
if (item != null) {
boolean isMain = item.isIsMain();
String fileName = item.getName();
if (isMain) {
fileName = "main." + fileName;
}
// log file name
buf.append(fileName);
if ((i + 1) < resourcesCount) {
buf.append(";");
}
addJarEntry(entries, item.getGrammar().getBytes("UTF-8"), RESOURCES_FOLDER_PATH_IN_JAR + File.separator + fileName);
}
}
// if the validation is WSDL, we need to add the schemas to
// validate the SOAP envelop
if (schema.getType() == SchemaValidationEnum.WSDL) {
addSOAPResources(entries, buf, RESOURCES_FOLDER_PATH_IN_JAR);
}
// write resources.list file
addJarEntry(entries, buf.toString().getBytes("UTF-8"), RESOURCES_FOLDER_PATH_IN_JAR + File.separator + "resources.list");