ImageService.java 文件源码

java
阅读 34 收藏 0 点赞 0 评论 0

项目:Learning-Spring-Boot-2.0-Second-Edition 作者:
/**
 * Pre-load some fake images
 *
 * @return Spring Boot {@link CommandLineRunner} automatically run after app context is loaded.
 */
@Bean
CommandLineRunner setUp() throws IOException {
    return (args) -> {
        FileSystemUtils.deleteRecursively(new File(UPLOAD_ROOT));

        Files.createDirectory(Paths.get(UPLOAD_ROOT));

        FileCopyUtils.copy("Test file",
            new FileWriter(UPLOAD_ROOT +
                "/learning-spring-boot-cover.jpg"));

        FileCopyUtils.copy("Test file2",
            new FileWriter(UPLOAD_ROOT +
                "/learning-spring-boot-2nd-edition-cover.jpg"));

        FileCopyUtils.copy("Test file3",
            new FileWriter(UPLOAD_ROOT + "/bazinga.png"));
    };
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号