String type = request.getParameter("type");
if(StringUtil.isEmpty(type)) {
throw new ServletException(StringUtil.format("'type' is not specified"));
}
IFileType fileType = loadFileType(type);
if(fileType==null) {
throw new ServletException(StringUtil.format("File type {0} is invalid", type));
}
// Then delegate to it
fileType.serviceProxy(request, response);
}