// A 'web {}' block was defined in configuration DSL
else {
// Go through all elements, look up the default one
boolean addDefaultAsFirst = true;
RebelWebResource defaultWeb = null;
for (RebelWebResource resource : web.getResources()) {
if (resource.isDefaultElement()) {
defaultWeb = resource;
addDefaultAsFirst = false;
break;
}
}
// Add the default one as first, if a specific location was not specified by the empty element
if (addDefaultAsFirst) {
if (web != null && !web.getOmitDefault()) {
buildDefaultWeb(model, defaultWeb);
}
}
// Add all the other elements from the user's configuration
List<RebelWebResource> resources = web.getResources();
if (resources != null && resources.size() > 0) {
for (int i = 0; i < resources.size(); i++) {
RebelWebResource resource = resources.get(i);
// Add the default element
if (resource.isDefaultElement()) {
if (!web.getOmitDefault()) {
buildDefaultWeb(model, resource);
}
}
// Add a normal, non-default element
else {
resource.setDirectory(fixFilePath(resource.getDirectory()));
model.addWebResource(resource);
}
}
}
}