本文整理汇总了Java中com.google.gerrit.server.account.AddSshKey类的典型用法代码示例。如果您正苦于以下问题:Java AddSshKey类的具体用法?Java AddSshKey怎么用?Java AddSshKey使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AddSshKey类属于com.google.gerrit.server.account包,在下文中一共展示了AddSshKey类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: AccountController
import com.google.gerrit.server.account.AddSshKey; //导入依赖的package包/类
@Inject
public AccountController(
final AddSshKey restAddSshKey,
final GetSshKeys restGetSshKeys,
final AccountManager accountManager,
final AccountCache accountCache,
final PutPreferred putPreferred,
final PutName putName) {
this.restAddSshKey = restAddSshKey;
this.restGetSshKeys = restGetSshKeys;
this.accountManager = accountManager;
this.accountCache = accountCache;
this.putPreferred = putPreferred;
this.putName = putName;
}
示例2: addSshKey
import com.google.gerrit.server.account.AddSshKey; //导入依赖的package包/类
private void addSshKey(final IdentifiedUser user, final String sshKeyWithLabel)
throws IOException {
AccountResource res = new AccountResource(user);
final ByteArrayInputStream keyIs = new ByteArrayInputStream(sshKeyWithLabel.getBytes());
AddSshKey.Input key = new AddSshKey.Input();
key.raw =
new RawInput() {
@Override
public InputStream getInputStream() throws IOException {
return keyIs;
}
@Override
public String getContentType() {
return "text/plain";
}
@Override
public long getContentLength() {
return sshKeyWithLabel.length();
}
};
try {
restAddSshKey.apply(res, key);
} catch (Exception e) {
log.error("Add key " + sshKeyWithLabel + " failed", e);
throw new IOException("Cannot store SSH Key '" + sshKeyWithLabel + "'", e);
}
}
示例3: AccountApiImpl
import com.google.gerrit.server.account.AddSshKey; //导入依赖的package包/类
@Inject
AccountApiImpl(
AccountLoader.Factory ailf,
ChangesCollection changes,
GetAvatar getAvatar,
GetPreferences getPreferences,
SetPreferences setPreferences,
GetDiffPreferences getDiffPreferences,
SetDiffPreferences setDiffPreferences,
GetEditPreferences getEditPreferences,
SetEditPreferences setEditPreferences,
GetWatchedProjects getWatchedProjects,
PostWatchedProjects postWatchedProjects,
DeleteWatchedProjects deleteWatchedProjects,
StarredChanges.Create starredChangesCreate,
StarredChanges.Delete starredChangesDelete,
Stars stars,
Stars.Get starsGet,
Stars.Post starsPost,
GetEmails getEmails,
CreateEmail.Factory createEmailFactory,
DeleteEmail deleteEmail,
GpgApiAdapter gpgApiAdapter,
GetSshKeys getSshKeys,
AddSshKey addSshKey,
DeleteSshKey deleteSshKey,
SshKeys sshKeys,
GetAgreements getAgreements,
PutAgreement putAgreement,
GetActive getActive,
PutActive putActive,
DeleteActive deleteActive,
Index index,
GetExternalIds getExternalIds,
DeleteExternalIds deleteExternalIds,
PutStatus putStatus,
GetGroups getGroups,
@Assisted AccountResource account) {
this.account = account;
this.accountLoaderFactory = ailf;
this.changes = changes;
this.getAvatar = getAvatar;
this.getPreferences = getPreferences;
this.setPreferences = setPreferences;
this.getDiffPreferences = getDiffPreferences;
this.setDiffPreferences = setDiffPreferences;
this.getEditPreferences = getEditPreferences;
this.setEditPreferences = setEditPreferences;
this.getWatchedProjects = getWatchedProjects;
this.postWatchedProjects = postWatchedProjects;
this.deleteWatchedProjects = deleteWatchedProjects;
this.starredChangesCreate = starredChangesCreate;
this.starredChangesDelete = starredChangesDelete;
this.stars = stars;
this.starsGet = starsGet;
this.starsPost = starsPost;
this.getEmails = getEmails;
this.createEmailFactory = createEmailFactory;
this.deleteEmail = deleteEmail;
this.getSshKeys = getSshKeys;
this.addSshKey = addSshKey;
this.deleteSshKey = deleteSshKey;
this.sshKeys = sshKeys;
this.gpgApiAdapter = gpgApiAdapter;
this.getAgreements = getAgreements;
this.putAgreement = putAgreement;
this.getActive = getActive;
this.putActive = putActive;
this.deleteActive = deleteActive;
this.index = index;
this.getExternalIds = getExternalIds;
this.deleteExternalIds = deleteExternalIds;
this.putStatus = putStatus;
this.getGroups = getGroups;
}