當前位置: 首頁>>代碼示例>>Java>>正文


Java Secret.getPlainText方法代碼示例

本文整理匯總了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());
}
 
開發者ID:riboseinc,項目名稱:aws-codecommit-trigger-plugin,代碼行數:4,代碼來源:StandardAwsCredentials.java

示例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;
    }
}
 
開發者ID:jenkinsci,項目名稱:cloudtest-plugin,代碼行數:74,代碼來源:CloudTestServer.java


注:本文中的hudson.util.Secret.getPlainText方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。