in src/java/org/apache/fulcrum/intake/model/UploadPartField.java [147:211]
public boolean validate()
{
ParameterParser pp = (ParameterParser) super.parser;
if (isMultiValued())
{
Part[] ss = pp.getParts(getKey());
// this definition of not set might need refined. But
// not sure the situation will arise.
if (ss.length == 0)
{
setSet(false);
}
if (getValidator() != null)
{
for (int i = 0; i < ss.length; i++)
{
try
{
((FileValidator) getValidator()).assertValidity(ss[i]);
}
catch (ValidationException ve)
{
setMessage(ve.getMessage());
}
}
}
if (isSet() && isValid())
{
doSetValue();
}
}
else
{
Part s = pp.getPart(getKey());
if (s == null || s.getSize() == 0)
{
setSet(false);
}
if (getValidator() != null)
{
try
{
((FileValidator) getValidator()).assertValidity(s);
if (isSet())
{
doSetValue();
}
}
catch (ValidationException ve)
{
setMessage(ve.getMessage());
}
}
else if (isSet())
{
doSetValue();
}
}
return isValid();
}