ValidationInfo (@NotNull String path) { try { Path directoryPath = Paths.get(path); if (!directoryPath.toFile().exists()) { Files.createDirectories(directoryPath); } else if (!directoryPath.toFile().isDirectory()) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.access")).withOKEnabled(); } return null; } catch (InvalidPathException e) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.invalid")); } catch (Exception e) { return new ValidationInfo(DvcsBundle.message("clone.destination.directory.error.access")).withOKEnabled(); } }