本文整理匯總了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;
}