File转换成MultipartFile
引入
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-mock</artifactId>
<version>2.0.8</version>
</dependency>
File file = new File ("");
FileInputStream fileInputStream = new FileInputStream(file);
MultipartFile multipartFile = new MockMultipartFile(file.getName(), file.getName(),
ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);
UploadFileResult result = sysFileService.save(false, multipartFile,
UserSecurityUtil.getLoginSysUser().getId(), null, null);