public static String padFront(String input, char padding, int length) {
    if (input.length() > length) {
      throw new IllegalArgumentException("input \"" + input + "\" longer than maxLength=" + length);
    }
    int numPaddingCharacters = length - input.length();
    return StringUtils.repeat(padding, numPaddingCharacters) + input;
  }
Push the input string to the right by appending a character before it, usually a space.
@param input   the string to pad
@param padding the character to repeat to the left of the input string
@param length  the desired total length including the padding
@return padding characters + input
hbase-common/src/main/java/org/apache/hadoop/hbase/util/Strings.java