protected final AppFile createAppFile(String path, MultipartFile multipartFile) {
AppFile file = new AppFile();
file.setName(multipartFile.getOriginalFilename());
String contentType = multipartFile.getContentType();
MimeType mimeType = MimeType.getForFilename(multipartFile.getOriginalFilename());
if (mimeType != null) {
contentType = mimeType.getMimeType();
}
file.setType(contentType);
double megabyteSize = multipartFile.getSize() / MEGABYTE_CONVERSION;
file.setSize(megabyteSize);