Class PasswordUtils


  • public class PasswordUtils
    extends java.lang.Object
    Small helper class to mask potential passwords in a string.
    • Constructor Summary

      Constructors 
      Constructor Description
      PasswordUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String maskPasswords​(java.lang.String inStr)
      This method will mask the password if the parameter contains --.*password.*= or --.*pwd.*=
      static java.lang.Object maskPasswords​(java.lang.String key, java.lang.Object obj)
      This method will mask the password if the key contains --.*password.*= or --.*pwd.*=
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PasswordUtils

        public PasswordUtils()
    • Method Detail

      • maskPasswords

        public static java.lang.String maskPasswords​(java.lang.String inStr)
        This method will mask the password if the parameter contains --.*password.*= or --.*pwd.*=
        Parameters:
        inStr -
        Returns:
        Throws:
        java.io.UnsupportedEncodingException
      • maskPasswords

        public static java.lang.Object maskPasswords​(java.lang.String key,
                                                     java.lang.Object obj)
        This method will mask the password if the key contains --.*password.*= or --.*pwd.*=
        Parameters:
        key -
        obj -
        Returns:
        ******** if key contain password or pwd obj otherwise