protected Map<String, String> copyFileName(HttpServletRequest req) { Map<String, String> parts = new HashMap<>(); if (req.getContentType() == null) { return parts; } if (req.getContentType() != null && !req.getContentType().toLowerCase().contains("multipart/form-data")) { return parts; } try { Collection<Part> prs = req.getParts(); for (Part p : prs) { if (p instanceof ApplicationPart) { ApplicationPart ap = (ApplicationPart) p; parts.put(p.getName(), ap.getSubmittedFileName()); } } } catch (IOException | ServletException e) { e.printStackTrace(); } return parts; }
/** * Calls {@link #getSubmittedFileName()}. * * @deprecated Use {@link #getSubmittedFileName()} from Servlet 3.1 instead. * This method will be removed in Tomcat 8. */ @Deprecated public String getFilename() { return getSubmittedFileName(); }
ApplicationPart part = new ApplicationPart(item, location); parts.add(part); if (part.getSubmittedFileName() == null) { String name = part.getName(); String value = null;
ApplicationPart part = new ApplicationPart(item, location); parts.add(part); if (part.getSubmittedFileName() == null) { String name = part.getName(); String value = null;
ApplicationPart part = new ApplicationPart(item, mce); parts.add(part); if (part.getSubmittedFileName() == null) { String name = part.getName(); String value = null;
ApplicationPart part = new ApplicationPart(item, location); parts.add(part); if (part.getSubmittedFileName() == null) { String name = part.getName(); String value = null;