ResponseWriter responseWriter = facesContext.getResponseWriter();
InputFile inputFile = (InputFile) uiComponent;
String clientId = inputFile.getClientId(facesContext);
// Determine the valid content-types and maximum file size from the validator (if specified).
JavaScriptArray contentTypes = new JavaScriptArray();
JavaScriptFragment alloyNamespace = new JavaScriptFragment("A");
long maxFileSize = Long.MAX_VALUE;
InputFileValidator inputFileValidator = getInputFileValidator(inputFile);
if (inputFileValidator != null) {
String validContentTypes = inputFileValidator.getContentTypes();
if (validContentTypes != null) {
contentTypes = new JavaScriptArray(validContentTypes.split(","));
}
maxFileSize = inputFileValidator.getMaxFileSize();
}