String (@NotNull Project project, @NotNull GithubApiRequestExecutor executor, @NotNull ProgressIndicator indicator, @NotNull GithubServerPath server, @NotNull List<? extends FileContent> contents, final boolean isSecret, @NotNull final String description, @Nullable String filename) { if (contents.isEmpty()) { GithubNotifications.showWarning(project, GithubNotificationIdsHolder.GIST_CANNOT_CREATE, GithubBundle.message("cannot.create.gist"), GithubBundle.message("create.gist.error.empty")); return null; } if (contents.size() == 1 && filename != null) { FileContent entry = contents.iterator().next(); contents = Collections.singletonList(new FileContent(filename, entry.getContent())); } try { return executor.execute(indicator, GithubApiRequests.Gists.create(server, contents, description, !isSecret)).getHtmlUrl(); } catch (IOException e) { GithubNotifications.showError(project, GithubNotificationIdsHolder.GIST_CANNOT_CREATE, GithubBundle.message("cannot.create.gist"), e); return null; } }