VirtualFile (final VirtualFile dir, String config) { final String configFileName = getExternalSystemConfigFileName(); VirtualFile configFile; try { configFile = WriteAction.computeAndWait(() -> { VirtualFile file = dir.findChild(configFileName); return file == null ? dir.createChildData(null, configFileName) : file; }); myAllConfigs.add(configFile); } catch (IOException e) { throw new RuntimeException(e); } setFileContent(configFile, config, true); return configFile; }