本文整理匯總了Java中hudson.util.Secret.getPlainText方法的典型用法代碼示例。如果您正苦於以下問題:Java Secret.getPlainText方法的具體用法?Java Secret.getPlainText怎麽用?Java Secret.getPlainText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類hudson.util.Secret
的用法示例。
在下文中一共展示了Secret.getPlainText方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: StandardAwsCredentials
import hudson.util.Secret; //導入方法依賴的package包/類
public StandardAwsCredentials(String description, String accessKey, Secret secretKey) {
this(CredentialsScope.GLOBAL, UUID.randomUUID().toString(), description, null, accessKey, secretKey.getPlainText());
}
示例2: CloudTestServer
import hudson.util.Secret; //導入方法依賴的package包/類
@DataBoundConstructor
public CloudTestServer(String url, String username, Secret password, String id, String name, String apitoken, String keyStoreLocation, Secret keyStorePassword, boolean trustSelfSigned) throws MalformedURLException {
this.keyStoreLocation = keyStoreLocation;
this.keyStorePassword = keyStorePassword;
this.trustSelfSigned = trustSelfSigned;
if (url == null || url.isEmpty()) {
// This is not really a valid case, but we have to store something.
this.url = null;
}
else {
// normalization
// TODO: can the service be running outside the /concerto/ URL?
if (!url.endsWith("/")) url+='/';
if (!url.endsWith("/concerto/"))
url+="concerto/";
this.url = url;
}
if (username == null || username.isEmpty()) {
this.username = "";
}
else {
this.username = username;
}
if (password == null || password.getPlainText() == null || password.getPlainText().isEmpty()) {
this.password = null;
}
else {
this.password = password;
}
if (apitoken == null || apitoken.isEmpty()) {
this.apitoken = "";
}
else {
this.apitoken = apitoken;
}
// If the ID is empty, auto-generate one.
if (id == null || id.isEmpty()) {
this.id = UUID.randomUUID().toString();
// This is probably a configuration created using
// an older version of the plug-in (before ID and name
// existed). Set a flag so we can write the new
// values after initialization (see DescriptorImpl).
generatedIdOrName = true;
}
else {
this.id = id;
}
// If the name is empty, default to URL + user name.
if (name == null || name.isEmpty()) {
if (this.url == null) {
this.name = "";
}
else {
this.name = url + " (" + username + ")";
// This is probably a configuration created using
// an older version of the plug-in (before ID and name
// existed). Set a flag so we can write the new
// values after initialization (see DescriptorImpl).
generatedIdOrName = true;
}
}
else {
this.name = name;
}
}