Set<FileInfo> testFiles = new LinkedHashSet<FileInfo>();
Set<FileInfo> resolvedFilesExclude = new LinkedHashSet<FileInfo>();
String server = "";
DocType doctype = docTypeParser.parse("quirks");
BasePaths basePaths = defaultBasePaths;
long timeOut = 0;
List<Plugin> plugins = Lists.newLinkedList();
JsonArray gatewayConfig = new JsonArray();
if (data.containsKey("load")) {
resolvedFilesLoad.addAll(createFileInfos((List<String>) data
.get("load"), false));
}
if (data.containsKey("test")) {
testFiles.addAll(createFileInfos((List<String>) data
.get("test"), false));
}
if (data.containsKey("exclude")) {
resolvedFilesExclude.addAll(createFileInfos((List<String>) data
.get("exclude"), false));
}
if (data.containsKey("server")) {
server = (String) data.get("server");
}
if (data.containsKey("plugin")) {
for (Map<String, String> value :
(List<Map<String, String>>) data.get("plugin")) {
plugins.add(new Plugin(value.get("name"), value.get("jar"),
value.get("module"), createArgsList(value.get("args"))));
}
}
if (data.containsKey("serve")) {
Set<FileInfo> resolvedServeFiles = createFileInfos((List<String>) data.get("serve"),
true);
resolvedFilesLoad.addAll(resolvedServeFiles);
}
if (data.containsKey("doctype")) {
doctype = docTypeParser.parse((String) data.get("doctype"));
}
if (data.containsKey("timeout")) {
timeOut = (Long) data.get("timeout");
}
if (data.containsKey("basepath")) {
Object rawBasePaths = data.get("basepath");
List<String> stringBasePaths = Lists.newArrayList();
if (rawBasePaths instanceof String) {
stringBasePaths.add((String) data.get("basepath"));
} else if (rawBasePaths instanceof List) {
stringBasePaths.addAll((List<String>) rawBasePaths);
}
for (String stringPath : stringBasePaths) {
File basePath = new File(stringPath);
if (!basePath.isAbsolute()) {
basePaths = basePaths.applyRelativePath(stringPath);
} else {
basePaths.add(basePath);
}
}
}
if (data.containsKey("proxy")) {
copyDataToGatewayConfig(data, "proxy", gatewayConfig);