private static FileContent makeFileContentWithContent(InputStream content, String filename) throws IOException { String contentType = MimeTypeUtils.getMimeTypeByFilename(filename); return FileContent.create(content, contentType, content.available()).withFilename(filename); }
private static FileContent makeFileContentWithFileItem(FileItem fi) throws IOException { return FileContent.createWithFileItem(fi).withFilename(fi.getName()); }