String (@NotNull VirtualFile chosenFile) { if (chosenFile.isDirectory()) { return chosenFile.getPath(); } Url url = virtualFileToUrl(chosenFile, project); return url == null ? chosenFile.getUrl() : url.toDecodedForm(); }