private void setSuffix(String suffix) throws IllegalArgumentException {
        // method code stolen from the logging subsystem
        final SimpleDateFormat format = new SimpleDateFormat(suffix);
        format.setTimeZone(timeZone);
        final int len = suffix.length();
        Period period = Period.NEVER;
        for (int i = 0; i < len; i ++) {
            switch (suffix.charAt(i)) {
                case 'y': period = min(period, Period.YEAR); break;
                case 'M': period = min(period, Period.MONTH); break;
                case 'w':
                case 'W': period = min(period, Period.WEEK); break;
                case 'D':
                case 'd':
                case 'F':
                case 'E': period = min(period, Period.DAY); break;
                case 'a': period = min(period, Period.HALF_DAY); break;
                case 'H':
                case 'k':
                case 'K':
                case 'h': period = min(period, Period.HOUR); break;
                case 'm': period = min(period, Period.MINUTE); break;
                case '\'': while (suffix.charAt(++i) != '\''){} break;
                case 's':
                case 'S': throw new IllegalArgumentException("Rotating by second or millisecond is not supported");
            }
        }
        this.format = format;
        this.period = period;
    }
private void setSuffix ( String suffix ) throws IllegalArgumentException { final SimpleDateFormat format = new SimpleDateFormat ( suffix ) ; format . setTimeZone ( timeZone ) ; final int len = suffix . length ( ) ; Period period = Period . NEVER ; for ( int i = 0 ; i < len ; i ++ ) { switch ( suffix . charAt ( i ) ) { case 'y' : period = min ( period , Period . YEAR ) ; break ; case 'M' : period = min ( period , Period . MONTH ) ; break ; case 'w' : case 'W' : period = min ( period , Period . WEEK ) ; break ; case 'D' : case 'd' : case 'F' : case 'E' : period = min ( period , Period . DAY ) ; break ; case 'a' : period = min ( period , Period . HALF_DAY ) ; break ; case 'H' : case 'k' : case 'K' : case 'h' : period = min ( period , Period . HOUR ) ; break ; case 'm' : period = min ( period , Period . MINUTE ) ; break ; case '\'' : while ( suffix . charAt ( ++ i ) != '\'' ) { } break ; case 's' : case 'S' : throw new IllegalArgumentException ( "Rotating by second or millisecond is not supported" ) ; } } this . format = format ; this . period = period ; }
Set the suffix string.  The string is in a format which can be understood by {@link java.text.SimpleDateFormat}.
The period of the rotation is automatically calculated based on the suffix.

@param suffix the suffix
@throws IllegalArgumentException if the suffix is not valid