public static String file2String(MultipartFile file) {
        try (InputStream inputStream = file.getInputStream()) {
            return IOUtils.toString(inputStream, StandardCharsets.UTF_8);
        } catch (IOException e) {
            log.error("file convert to string failed: {}", file.getName());
        }

        return "";
    }
@Test
    public void testFile2String() throws IOException {
        String content = "123";
        org.apache.commons.io.FileUtils.writeStringToFile(new File("/tmp/task.json"), content,
                Charset.defaultCharset());

        File file = new File("/tmp/task.json");
        FileInputStream fileInputStream = new FileInputStream("/tmp/task.json");
        MultipartFile multipartFile = new MockMultipartFile(file.getName(), file.getName(),
                ContentType.APPLICATION_OCTET_STREAM.toString(), fileInputStream);

        String resultStr = FileUtils.file2String(multipartFile);

        Assertions.assertEquals(content, resultStr);

        boolean delete = file.delete();

        Assertions.assertTrue(delete);
    }