Java 类com.intellij.openapi.util.PasswordUtil 实例源码

项目:jfrog-idea-plugin    文件:XrayServerConfig.java   
@CheckForNull
public String getPassword() {
    if (password == null) {
        return null;
    }
    try {
        return PasswordUtil.decodePassword(password);
    } catch (NumberFormatException e) {
        return null;
    }
}
项目:jfrog-idea-plugin    文件:XrayServerConfig.java   
public Builder setPassword(@Nullable String password) {
    if (password != null) {
        this.password = PasswordUtil.encodePassword(password);
    } else {
        this.password = "";
    }
    return this;
}
项目:intellij-ce-playground    文件:RemoteCredentialsHolder.java   
@NotNull
public String getSerializedPassword() {
  if (myAnonymous) return "";

  if (myStorePassword) {
    return PasswordUtil.encodePassword(myPassword);
  }
  else {
    return "";
  }
}
项目:intellij-ce-playground    文件:RemoteCredentialsHolder.java   
public void setSerializedPassword(String serializedPassword) {
  if (!StringUtil.isEmpty(serializedPassword)) {
    myPassword = PasswordUtil.decodePassword(serializedPassword);
    myStorePassword = true;
  }
  else {
    myPassword = null;
  }
}
项目:intellij-ce-playground    文件:RemoteCredentialsHolder.java   
@NotNull
public String getSerializedPassphrase() {
  if (myStorePassphrase) {
    return PasswordUtil.encodePassword(myPassphrase);
  }
  else {
    return "";
  }
}
项目:intellij-ce-playground    文件:RemoteCredentialsHolder.java   
public void setSerializedPassphrase(String serializedPassphrase) {
  if (!StringUtil.isEmpty(serializedPassphrase)) {
    myPassphrase = PasswordUtil.decodePassword(serializedPassphrase);
    myStorePassphrase = true;
  }
  else {
    myPassphrase = null;
    myStorePassphrase = false;
  }
}
项目:intellij-ce-playground    文件:FogBugzRepository.java   
@SuppressWarnings("unused")
public void setEncodedToken(@Nullable String token) {
  try {
    myToken = PasswordUtil.decodePassword(token);
  }
  catch (NumberFormatException ignored) {
  }
}
项目:intellij-ce-playground    文件:BaseRepository.java   
public void setEncodedPassword(String password) {
  try {
    setPassword(PasswordUtil.decodePassword(password));
  }
  catch (NumberFormatException e) {
    // do nothing
  }
}
项目:intellij-ce-playground    文件:GithubRepository.java   
public void setEncodedToken(String password) {
  try {
    setToken(PasswordUtil.decodePassword(password));
  }
  catch (NumberFormatException e) {
    LOG.warn("Can't decode token", e);
  }
}
项目:tools-idea    文件:RemoteCredentialsHolder.java   
public String getSerializedPassword() {
  if (myAnonymous) return "";

  if (myStorePassword) {
    return PasswordUtil.encodePassword(myPassword);
  }
  else {
    return "";
  }
}
项目:tools-idea    文件:RemoteCredentialsHolder.java   
public void setSerializedPassword(String serializedPassword) {
  if (!StringUtil.isEmpty(serializedPassword)) {
    myPassword = PasswordUtil.decodePassword(serializedPassword);
    myStorePassword = true;
  }
  else {
    myPassword = null;
  }
}
项目:tools-idea    文件:RemoteCredentialsHolder.java   
@Nullable
public String getSerializedPassphrase() {
  if (myStorePassphrase) {
    return PasswordUtil.encodePassword(myPassphrase);
  }
  else {
    return "";
  }
}
项目:tools-idea    文件:RemoteCredentialsHolder.java   
public void setSerializedPassphrase(String serializedPassphrase) {
  if (!StringUtil.isEmpty(serializedPassphrase)) {
    myPassphrase = PasswordUtil.decodePassword(serializedPassphrase);
    myStorePassphrase = true;
  }
  else {
    myPassphrase = null;
    myStorePassphrase = false;
  }
}
项目:tools-idea    文件:BaseRepository.java   
public void setEncodedPassword(String password) {
  try {
    setPassword(PasswordUtil.decodePassword(password));
  }
  catch (NumberFormatException e) {
    // do nothing
  }
}
项目:tools-idea    文件:GithubRepository.java   
public void setEncodedToken(String password) {
  try {
    setToken(PasswordUtil.decodePassword(password));
  }
  catch (NumberFormatException e) {
    LOG.warn("Can't decode token", e);
  }
}
项目:consulo-tasks    文件:BaseRepository.java   
public void setEncodedPassword(String password)
{
    try
    {
        setPassword(PasswordUtil.decodePassword(password));
    }
    catch(NumberFormatException e)
    {
        // do nothing
    }
}
项目:consulo    文件:RemoteCredentialsHolder.java   
@Nonnull
public String getSerializedPassword() {
  if (myAnonymous) return "";

  if (myStorePassword) {
    return PasswordUtil.encodePassword(myPassword);
  }
  else {
    return "";
  }
}
项目:consulo    文件:RemoteCredentialsHolder.java   
public void setSerializedPassword(String serializedPassword) {
  if (!StringUtil.isEmpty(serializedPassword)) {
    myPassword = PasswordUtil.decodePassword(serializedPassword);
    myStorePassword = true;
  }
  else {
    myPassword = null;
  }
}
项目:consulo    文件:RemoteCredentialsHolder.java   
@Nonnull
public String getSerializedPassphrase() {
  if (myStorePassphrase) {
    return PasswordUtil.encodePassword(myPassphrase);
  }
  else {
    return "";
  }
}
项目:consulo    文件:RemoteCredentialsHolder.java   
public void setSerializedPassphrase(String serializedPassphrase) {
  if (!StringUtil.isEmpty(serializedPassphrase)) {
    myPassphrase = PasswordUtil.decodePassword(serializedPassphrase);
    myStorePassphrase = true;
  }
  else {
    myPassphrase = null;
    myStorePassphrase = false;
  }
}
项目:intellij-ce-playground    文件:FogBugzRepository.java   
@Tag("token")
@NotNull
public String getEncodedToken() {
  // The same approach as used for passwords in BaseRepository
  return PasswordUtil.encodePassword(myToken);
}
项目:intellij-ce-playground    文件:BaseRepository.java   
@Tag("password")
public String getEncodedPassword() {
  return PasswordUtil.encodePassword(getPassword());
}
项目:intellij-ce-playground    文件:GithubRepository.java   
@Tag("token")
public String getEncodedToken() {
  return PasswordUtil.encodePassword(getToken());
}
项目:vso-intellij    文件:Credentials.java   
@Nullable
@Tag(value = "password")
public String getEncodedPassword() {
  return myStorePassword && myPassword != null ? PasswordUtil.encodePassword(myPassword) : null;
}
项目:vso-intellij    文件:Credentials.java   
public void setEncodedPassword(String encodedPassword) {
  myPassword = encodedPassword != null ? PasswordUtil.decodePassword(encodedPassword) : null;
  myStorePassword = true;
}
项目:tools-idea    文件:BaseRepository.java   
@Tag("password")
public String getEncodedPassword() {
  return PasswordUtil.encodePassword(getPassword());
}
项目:tools-idea    文件:GithubRepository.java   
@Tag("token")
public String getEncodedToken() {
  return PasswordUtil.encodePassword(getToken());
}
项目:consulo-tasks    文件:BaseRepository.java   
@Tag("password")
public String getEncodedPassword()
{
    return PasswordUtil.encodePassword(getPassword());
}