*/
private EC2Filter[] extractFilters( HttpServletRequest request )
{
String filterName = null;
String value = null;
EC2Filter nextFilter = null;
boolean timeFilter = false;
int filterCount = 1;
int valueCount = 1;
List<EC2Filter> filterSet = new ArrayList<EC2Filter>();
do
{ filterName = request.getParameter( "Filter." + filterCount + ".Name" );
if (null != filterName)
{
nextFilter = new EC2Filter();
nextFilter.setName( filterName );
timeFilter = (filterName.equalsIgnoreCase( "attachment.attach-time" ) || filterName.equalsIgnoreCase( "create-time" ));
valueCount = 1;
do
{
value = request.getParameter( "Filter." + filterCount + ".Value." + valueCount );
if (null != value)
{
// -> time values are not encoded as regexes
if ( timeFilter )
nextFilter.addValue( value );
else nextFilter.addValueEncoded( value );
valueCount++;
}
}
while( null != value );