ApacheMultiPartManager implements MultiPartManager { @Override public Part getPart(WebApplication webApplication, WebApplicationRequest request, String name) throws ServletException { ApacheMultiPart result = null; LOGGER.log(FINE, "Getting part: {0} for request: {1}", new Object[]{name, request}); if (ServletFileUpload.isMultipartContent(request)) { try { ServletFileUpload upload = setupFileUpload(webApplication); List<FileItem> items = upload.parseRequest(request); for (FileItem item : items) { if (item.getName().equals(name)) { result = new ApacheMultiPart(item); break; } } } catch (FileUploadException fue) { LOGGER.log(WARNING, "Error getting part", fue); } } else { throw new ServletException("Not a multipart/form-data request"); } return result; }  @Override Collection<Part> getParts(WebApplication webApplication,
            WebApplicationRequest request); @Override Part getPart(WebApplication webApplication,
            WebApplicationRequest request, String name);  }
@Test void testGetPart() throws Exception { DefaultWebApplication application = new DefaultWebApplication(); DefaultWebApplicationRequest request = new DefaultWebApplicationRequest(); request.setContentType("multipart/form-data"); request.setMethod("POST"); ApacheMultiPartManager manager = new ApacheMultiPartManager(); assertNull(manager.getPart(application, request, "part_test")); }