public String toRegexForFixedDate ( Date date ) { StringBuilder buf = new StringBuilder ( ) ; Converter < Object > p = headTokenConverter ; while ( p != null ) { if ( p instanceof LiteralConverter ) { buf . append ( p . convert ( null ) ) ; } else if ( p instanceof IntegerTokenConverter ) { buf . append ( FileFinder . regexEscapePath ( "(\\d+)" ) ) ; } else if ( p instanceof DateTokenConverter ) { DateTokenConverter < Object > dtc = ( DateTokenConverter < Object > ) p ; if ( dtc . isPrimary ( ) ) { buf . append ( p . convert ( date ) ) ; } else { buf . append ( FileFinder . regexEscapePath ( dtc . toRegex ( ) ) ) ; } } p = p . getNext ( ) ; } return buf . toString ( ) ; }
Given date convert this instance to a regular expression .