当前位置: 首页>>代码示例>>Java>>正文


Java PersonIdent.getEmailAddress方法代码示例

本文整理汇总了Java中org.eclipse.jgit.lib.PersonIdent.getEmailAddress方法的典型用法代码示例。如果您正苦于以下问题:Java PersonIdent.getEmailAddress方法的具体用法?Java PersonIdent.getEmailAddress怎么用?Java PersonIdent.getEmailAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.lib.PersonIdent的用法示例。


在下文中一共展示了PersonIdent.getEmailAddress方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toCommit

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private static Commit toCommit(RevCommit revCommit) {
    final Author author;
    final PersonIdent committerIdent = revCommit.getCommitterIdent();
    if (committerIdent == null) {
        author = Author.UNKNOWN;
    } else {
        author = new Author(committerIdent.getName(), committerIdent.getEmailAddress());
    }
    long when = committerIdent.getWhen().getTime();

    try {
        return CommitUtil.newCommit(author, when, revCommit.getFullMessage());
    } catch (Exception e) {
        throw new StorageException("failed to create a Commit", e);
    }
}
 
开发者ID:line,项目名称:centraldogma,代码行数:17,代码来源:GitRepository.java

示例2: createCommitInfo

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public CommitInfo createCommitInfo(RevCommit entry) {
    final Date date = GitUtils.getCommitDate(entry);
    PersonIdent authorIdent = entry.getAuthorIdent();
    String author = null;
    String name = null;
    String email = null;
    String avatarUrl = null;
    if (authorIdent != null) {
        author = authorIdent.getName();
        name = authorIdent.getName();
        email = authorIdent.getEmailAddress();

        // lets try default the avatar
        if (Strings.isNotBlank(email)) {
            avatarUrl = getAvatarUrl(email);
        }
    }
    boolean merge = entry.getParentCount() > 1;
    String shortMessage = entry.getShortMessage();
    String sha = entry.getName();
    return new CommitInfo(sha, author, name, email, avatarUrl, date, merge, shortMessage);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:23,代码来源:RepositoryResource.java

示例3: getAuthors

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
/**
 * Gets a set of authors for a path in a given repository
 * @param repo The git repository
 * @param path The path to get commits for
 * @return An iterable of commits
 * @throws GitAPIException Any API errors which may occur
 * @throws URISyntaxException Error constructing mailto link
 */
public Set<HashableAgent> getAuthors(Git repo, String path) throws GitAPIException, URISyntaxException {
    Iterable<RevCommit> logs = repo.log().addPath(path).call();
    Set<HashableAgent> fileAuthors = new HashSet<>();
    for (RevCommit rev : logs) {
        // Use author first with backup of committer
        PersonIdent author = rev.getAuthorIdent();
        if (author == null) {
            author = rev.getCommitterIdent();
        }
        // Create a new agent and add as much detail as possible
        if (author != null) {
            HashableAgent newAgent = new HashableAgent();
            String name = author.getName();
            if (name != null && name.length() > 0) {
                newAgent.setName(author.getName());
            }
            String email = author.getEmailAddress();
            if (email != null && email.length() > 0) {
                newAgent.setUri(new URI("mailto:" + author.getEmailAddress()));
            }
            fileAuthors.add(newAgent);
        }
    }
    return fileAuthors;
}
 
开发者ID:common-workflow-language,项目名称:cwlviewer,代码行数:34,代码来源:GitService.java

示例4: appendPersonIdent

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private static void appendPersonIdent(StringBuilder b, String field, PersonIdent person) {
  if (person != null) {
    b.append(field).append(":    ");
    if (person.getName() != null) {
      b.append(" ");
      b.append(person.getName());
    }
    if (person.getEmailAddress() != null) {
      b.append(" <");
      b.append(person.getEmailAddress());
      b.append(">");
    }
    b.append("\n");

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ZZZ");
    sdf.setTimeZone(person.getTimeZone());
    b.append(field).append("Date: ");
    b.append(sdf.format(person.getWhen()));
    b.append("\n");
  }
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:22,代码来源:Text.java

示例5: commit

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
@Override
public boolean commit( String authorName, String message ) {
  PersonIdent author = RawParseUtils.parsePersonIdent( authorName );
  // Set the local time
  PersonIdent author2 = new PersonIdent( author.getName(), author.getEmailAddress(),
      SystemReader.getInstance().getCurrentTime(),
      SystemReader.getInstance().getTimezone( SystemReader.getInstance().getCurrentTime() ) );
  try {
    git.commit().setAuthor( author2 ).setMessage( message ).call();
    return true;
  } catch ( Exception e ) {
    showMessageBox( BaseMessages.getString( PKG, "Dialog.Error" ), e.getMessage() );
    return false;
  }
}
 
开发者ID:HiromuHota,项目名称:pdi-git-plugin,代码行数:16,代码来源:UIGit.java

示例6: toGitPerson

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public static GitPerson toGitPerson(PersonIdent ident) {
  GitPerson result = new GitPerson();
  result.name = ident.getName();
  result.email = ident.getEmailAddress();
  result.date = new Timestamp(ident.getWhen().getTime());
  result.tz = ident.getTimeZoneOffset();
  return result;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:9,代码来源:CommonConverters.java

示例7: parseIdent

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public static Optional<Account.Id> parseIdent(PersonIdent ident, String serverId) {
  String email = ident.getEmailAddress();
  int at = email.indexOf('@');
  if (at >= 0) {
    String host = email.substring(at + 1, email.length());
    if (host.equals(serverId)) {
      Integer id = Ints.tryParse(email.substring(0, at));
      if (id != null) {
        return Optional.of(new Account.Id(id));
      }
    }
  }
  return Optional.empty();
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:15,代码来源:NoteDbUtil.java

示例8: asAccountAttribute

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
/**
 * Create an AuthorAttribute for the given person ident suitable for serialization to JSON.
 *
 * @param ident
 * @return object suitable for serialization to JSON
 */
public AccountAttribute asAccountAttribute(PersonIdent ident) {
  AccountAttribute who = new AccountAttribute();
  who.name = ident.getName();
  who.email = ident.getEmailAddress();
  return who;
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:13,代码来源:EventFactory.java

示例9: NameAndEmail

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public NameAndEmail(PersonIdent person) {
	this(person.getName(), person.getEmailAddress());
}
 
开发者ID:jmfgdev,项目名称:gitplex-mit,代码行数:4,代码来源:NameAndEmail.java

示例10: author

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public String author() {
    PersonIdent ident = commit.getAuthorIdent();
    return ident.getName() + " " + ident.getEmailAddress();
}
 
开发者ID:kszatan,项目名称:gocd-phabricator-staging-material,代码行数:5,代码来源:Commit.java

示例11: prersonIndentContains

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private boolean prersonIndentContains(PersonIdent prersonIndent, String searchString) {
    return prersonIndent != null
            && (prersonIndent.getEmailAddress() != null
            && prersonIndent.getEmailAddress().toLowerCase().contains(searchString.toLowerCase()));

}
 
开发者ID:iazarny,项目名称:gitember,代码行数:7,代码来源:BranchViewController.java

示例12: PersonIdentDTO

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
public PersonIdentDTO(PersonIdent ident) {
    this.name = ident.getName();
    this.emailAddress = ident.getEmailAddress();
    this.timeZone = ident.getTimeZone().getID();
    this.when = ident.getWhen();
}
 
开发者ID:fabric8io,项目名称:fabric8-devops,代码行数:7,代码来源:PersonIdentDTO.java

示例13: toAddress

import org.eclipse.jgit.lib.PersonIdent; //导入方法依赖的package包/类
private static Address toAddress(PersonIdent myIdent) {
  return new Address(myIdent.getName(), myIdent.getEmailAddress());
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:4,代码来源:FromAddressGeneratorProvider.java


注:本文中的org.eclipse.jgit.lib.PersonIdent.getEmailAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。