2018-07-03 14:41:11 UTC
I am using the commons.fileupload library to parse a multipart request.
public void post(@Context HttpServletRequest request) throws Exception
List<FileItem> multiParts = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request);
for(FileItem part : multiParts)
System.out.printf("File %s, %s, %d%n", part.getName(),
The method is part of a small osgi based app, that utilizes the HttpWhiteboard to implement a REST service.
The shown code is working.
Unfortunately, this is called by a quite old system, that does not provide a name field for each part.
The library ignores all parts, that does not have a name.
Is there any easy solution, how to avoid ignoring the unnamed parts?
Is it possible the set a random name if it does not exist?