I have a SpringBoot app where I read a folder of the resource folder of the app. but I would like to know if it is possible also to create a folder in the resource folder
File folderFrom = ResourceUtils.getFile("classpath:icons/svg/white/");
something like
File folderTo = ResourceUtils.createFolder("classpath:icons/svg/black/");
I trying to do it from Eclipse:
@SpringBootApplication
public class SvgManagerApplication implements CommandLineRunner {
public static void main(String[] args) {
SpringApplication.run(SvgManagerApplication.class, args);
}
@Override
public void run(String... args) throws Exception {
..
}
}
You can use java.utils
to create a folder inside the resource directory
new File("/path/directory").mkdirs();
"directory" is the name for the folder you want to create
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.