commons-file/src/main/java/info/monitorenter/util/StringUtil.java
public static final String setSize(final String s, final int length) {
    String result = s;
    int oldlen = s.length();
    if (oldlen > length) {
      System.err.println("greenpeace.util.setSize(String s,int length): length (" + length
          + ") is smaller than s.length(" + oldlen + ") : " + s);
    } else {
      int tofill = length - oldlen;
      result = StringUtil.appendSpaces(s, tofill);
    }
    return result;
  }
public static final String setSize(final String s, final int length) {
    String result = s;
    int oldlen = s.length();
    if (oldlen > length) {
      System.err.println("greenpeace.util.setSize(String s,int length): length (" + length
          + ") is smaller than s.length(" + oldlen + ") : " + s);
    } else {
      int tofill = length - oldlen;
      result = StringUtil.appendSpaces(s, tofill);
    }
    return result;
  }
public static final String setSize ( final String s , final int length ) { String result = s ; int oldlen = s . length ( ) ; if ( oldlen > length ) { System . err . println ( "greenpeace.util.setSize(String s,int length): length (" + length + ") is smaller than s.length(" + oldlen + ") : " + s ) ; } else { int tofill = length - oldlen ; result = StringUtil . appendSpaces ( s , tofill ) ; } return result ; }
Appends the necessary amount of spaces to the string until it has the givn
length. No Exception is thrown, if the length of the String is shorter than
the given length, but nothing will happen and a message will be printed to
the System.out.


@param s
the String to expand.
@param length
the desired length of the String to be returned.
@return A String that represents the content of the old String including
extra whitespaces.
Appends the necessary amount of spaces to the string until it has the givn length . No Exception is thrown if the length of the String is shorter than the given length but nothing will happen and a message will be printed to the System . out .