Tabnine Logo
GHMyself
Code IndexAdd Tabnine to your IDE (free)

How to use
GHMyself
in
org.kohsuke.github

Best Java code snippets using org.kohsuke.github.GHMyself (Showing top 20 results out of 315)

origin: groupon/DotCi

public String getCurrentLogin() {
  return this.user.getLogin();
}
origin: groupon/DotCi

public Iterable<GHRepository> getRepositories(final String orgName) {
  try {
    if (orgName.equals(this.user.getLogin())) {
      return this.gh.getMyself().listRepositories();
    } else {
      return this.gh.getOrganization(orgName).listRepositories();
    }
  } catch (final IOException e) {
    throw new RuntimeException(e);
  }
}
origin: kohsuke/github-api

/**
 * @deprecated
 *      Use {@link #getEmails2()}
 */
public List<String> getEmails() throws IOException {
  List<GHEmail> src = getEmails2();
  List<String> r = new ArrayList<String>(src.size());
  for (GHEmail e : src) {
    r.add(e.getEmail());
  }
  return r;
}
origin: jenkinsci/ghprb-plugin

@POST
public FormValidation doTestGithubAccess(
    @QueryParameter("serverAPIUrl") final String serverAPIUrl,
    @QueryParameter("credentialsId") final String credentialsId) {
  Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);
  try {
    GitHubBuilder builder = getBuilder(null, serverAPIUrl, credentialsId);
    if (builder == null) {
      return FormValidation.error("Unable to look up GitHub credentials using ID: " + credentialsId + "!!");
    }
    GitHub gh = builder.build();
    GHMyself me = gh.getMyself();
    String name = me.getName();
    String email = me.getEmail();
    String login = me.getLogin();
    String comment = String.format("Connected to %s as %s (%s) login: %s", serverAPIUrl, name, email, login);
    return FormValidation.ok(comment);
  } catch (Exception ex) {
    return FormValidation.error("Unable to connect to GitHub API: " + ex);
  }
}
origin: qaprosoft/zafira

@Override
public List<Organization> getOrganizations(String accessToken) throws IOException, ServiceException {
  GitHub gitHub = GitHub.connectUsingOAuth(accessToken);
  List<Organization> organizations = gitHub.getMyself().getAllOrganizations().stream().map(organization -> {
    Organization result = new Organization(organization.getLogin());
    result.setAvatarURL(organization.getAvatarUrl());
    return result;
  }).collect(Collectors.toList());
  Organization myself = new Organization(gitHub.getMyself().getLogin());
  myself.setAvatarURL(gitHub.getMyself().getAvatarUrl());
  organizations.add(myself);
  return organizations;
}
origin: org.jenkins-ci.plugins/github-branch-source

  throw new AbortException(rle.getMessage());
if (myself != null && repoOwner.equalsIgnoreCase(myself.getLogin())) {
  listener.getLogger().format("Looking up %s repository of myself %s%n%n", sourceName, repoOwner);
  GHRepository repo = myself.getRepository(sourceName);
  if (repo != null && repo.getOwnerName().equals(repoOwner)) {
    if (request.process(repo.getName(), sourceFactory, null, witness)) {
origin: kohsuke/github-api

/**
 * Lists up all repositories this user owns (public and private).
 *
 * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned.
 * Repositories are returned by GitHub API with a 30 items per page.
 */
@Override
public PagedIterable<GHRepository> listRepositories() {
 return listRepositories(30);
}
origin: io.jenkins.updatebot/updatebot-core

GHMyself myself = github.getMyself();
if (myself != null) {
  email = myself.getEmail();
  personName = myself.getName();
  if (Strings.empty(personName)) {
    configuration.warn(LOG, "No name available for GitHub login!");
    personName = myself.getLogin();
origin: kohsuke/github-api

/**
 * @deprecated
 *      Use {@link #listRepositories()}
 */
public PagedIterable<GHRepository> listAllRepositories() {
  return listRepositories();
}
origin: salesforce/dockerfile-image-update

private void cleanBefore() throws Exception {
  String login = github.getMyself().getLogin();
  List<String> repoNames = Arrays.asList(
      Paths.get(login, NAME).toString(),
      Paths.get(ORG, NAME).toString(),
      Paths.get(login, STORE_NAME).toString());
  for (String repoName : repoNames) {
    TestCommon.checkAndDeleteBefore(repoName, github);
  }
}
origin: io.fabric8.updatebot/updatebot-core

GHMyself myself = github.getMyself();
if (myself != null) {
  email = myself.getEmail();
  personName = myself.getName();
  if (Strings.empty(personName)) {
    configuration.warn(LOG, "No name available for GitHub login!");
    personName = myself.getLogin();
origin: org.jenkins-ci.plugins/github-branch-source

  throw new FillErrorResponse(e.getMessage(), false);
if (myself != null && repoOwner.equalsIgnoreCase(myself.getLogin())) {
  Set<String> result = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
  for (GHRepository repo : myself.listRepositories(100, GHMyself.RepositoryListFilter.OWNER)) {
    result.add(repo.getName());
origin: org.kohsuke/github-api

/**
 * @deprecated
 *      Use {@link #listRepositories()}
 */
public PagedIterable<GHRepository> listAllRepositories() {
  return listRepositories();
}
origin: org.kohsuke/github-api

/**
 * @deprecated
 *      Use {@link #getEmails2()}
 */
public List<String> getEmails() throws IOException {
  List<GHEmail> src = getEmails2();
  List<String> r = new ArrayList<String>(src.size());
  for (GHEmail e : src) {
    r.add(e.getEmail());
  }
  return r;
}
origin: salesforce/dockerfile-image-update

  public static void addVersionStoreRepo(GitHub github, List<GHRepository> createdRepos, String storeName) throws IOException {
    String login = github.getMyself().getLogin();
    GHRepository storeRepo = github.getRepository(Paths.get(login, storeName).toString());
    createdRepos.add(storeRepo);
  }
}
origin: org.jenkins-ci.plugins/github-branch-source

  throw new AbortException(rle.getMessage());
if (myself != null && repoOwner.equalsIgnoreCase(myself.getLogin())) {
    listener.getLogger()
        .println(GitHubConsoleNote.create(System.currentTimeMillis(), String.format(
            "Looking up repositories of myself %s", repoOwner
        )));
  for (GHRepository repo : myself.listRepositories(100)) {
    Connector.checkApiRateLimit(listener, github);
    if (!repo.getOwnerName().equals(repoOwner)) {
origin: org.sonarsource.sonar-plugins.github/github-api

/**
 * Lists up all repositories this user owns (public and private).
 *
 * Unlike {@link #getAllRepositories()}, this does not wait until all the repositories are returned.
 * Repositories are returned by GitHub API with a 30 items per page.
 */
@Override
public PagedIterable<GHRepository> listRepositories() {
 return listRepositories(30);
}
origin: org.sonarsource.sonar-plugins.github/github-api

/**
 * @deprecated
 *      Use {@link #getEmails2()}
 */
public List<String> getEmails() throws IOException {
  List<GHEmail> src = getEmails2();
  List<String> r = new ArrayList<String>(src.size());
  for (GHEmail e : src) {
    r.add(e.getEmail());
  }
  return r;
}
origin: kohsuke/github-api

 /**
  * Returns the read-only list of all the public verified keys of the current user.
  *
  * Differently from the getPublicKeys() method, the retrieval of the user's
  * verified public keys does not require any READ/WRITE OAuth Scope to the
  * user's profile.
  *
  * @return
  *      Always non-null.
  */
public List<GHVerifiedKey> getPublicVerifiedKeys() throws IOException {
 return Collections.unmodifiableList(Arrays.asList(root.retrieve().to(
   "/users/" + getLogin() + "/keys", GHVerifiedKey[].class)));
}
origin: org.sonarsource.sonar-plugins.github/github-api

/**
 * @deprecated
 *      Use {@link #listRepositories()}
 */
public PagedIterable<GHRepository> listAllRepositories() {
  return listRepositories();
}
org.kohsuke.githubGHMyself

Javadoc

Represents the account that's logging into GitHub.

Most used methods

  • getLogin
  • listRepositories
    List repositories of a certain type that are accessible by current authenticated user using the spec
  • getEmail
  • getName
  • getEmails2
    Returns the read-only list of e-mail addresses configured for you. This corresponds to the stuff you
  • getRepository
  • listAllRepositories
  • getAllOrganizations
    Gets the organization that this user belongs to.
  • getAllRepositories
    Gets the all repositories this user owns (public and private).
  • getAvatarUrl
  • listOrgMemberships
    List your organization memberships
  • listOrgMemberships

Popular in Java

  • Finding current android device location
  • setRequestProperty (URLConnection)
  • onCreateOptionsMenu (Activity)
  • requestLocationUpdates (LocationManager)
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now