@NotNull
private ResolvedConfiguration resolveConfiguration() throws ExecutionException {
VirtualFile configVirtualFile = VfsUtil.findFileByIoFile(myConfigFile, false);
if (configVirtualFile == null) {
throw new ExecutionException("Cannot find JsTestDriver configuration file " + myConfigFile.getAbsolutePath());
}
BasePaths dirBasePaths = new BasePaths(myConfigFile.getParentFile());
final byte[] content;
try {
content = configVirtualFile.contentsToByteArray();
}
catch (IOException e) {
throw new ExecutionException("Cannot read JsTestDriver configuration file " + configVirtualFile.getPath());
}
Reader reader = new InputStreamReader(new ByteArrayInputStream(content), Charset.defaultCharset());
try {
YamlParser yamlParser = new YamlParser();
ParsedConfiguration parsedConfiguration = (ParsedConfiguration) yamlParser.parse(reader, dirBasePaths);
JstdConfigParsingUtils.wipeCoveragePlugin(parsedConfiguration);
return JstdConfigParsingUtils.resolveConfiguration(parsedConfiguration);
}
catch (Exception e) {
String message = "Malformed JsTestDriver configuration file " + configVirtualFile.getPath();
LOG.warn(message, e);
throw new ExecutionException(message);
}
finally {
try {
reader.close();
}