// Loop through items
for (Iterator<FileItem> i = items.iterator(); i.hasNext();)
{
// Get next item
final FileItem item = i.next();
// If item is a form field
if (item.isFormField())
{
// Set parameter value
final String value;
if (encoding != null)
{
try
{
value = item.getString(encoding);
}
catch (UnsupportedEncodingException e)
{
throw new WicketRuntimeException(e);
}
}
else
{
value = item.getString();
}
addParameter(item.getFieldName(), value);
}
else
{
// Add to file list
files.put(item.getFieldName(), item);
}
}
}