class MultiPartFormUploadServlet extends HttpServlet {

    @Override
    protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();

        boolean isMultipartContent = ServletFileUpload.isMultipartContent(request);
        if (!isMultipartContent) {
            out.println("You are not trying to upload");
        } else {
            try {
                List<FileItem> fields = servletFileUpload.parseRequest(request);
                String msg = multiPartFileParser.parseMultiPartFiles(fields);
                LOGGER.info(urlAccessLogMessageAssembler.assembleMessage(request, msg));
                out.write(msg);
            } catch (Exception e) {
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
                out.write("File uploading failed! cause: " + e.getMessage());
                LOGGER.info(urlAccessLogMessageAssembler.assembleMessage(request, e.getMessage()), e);
            }
        }
    }

    @Autowired public  MultiPartFormUploadServlet(final ServletFileUploadFactory servletFileUploadFactory, final MultiPartFileParser multiPartFileParser,
                                      final UrlAccessLogMessageAssembler urlAccessLogMessageAssembler);

}