Create intermediate folders if one doesn't exist

后端 未结 3 596
别跟我提以往
别跟我提以往 2020-12-24 10:46

I am trying to create a folder for each username a user logs in as. Currently I have

private String destination = \"C:/Users/Richard/printing~subversion/file         


        
3条回答
  •  离开以前
    2020-12-24 11:30

    A nice Java 7+ answer from Benoit Blanchon can be found here:

    With Java 7, you can use Files.createDirectories().

    For instance:

    Files.createDirectories(Paths.get("/path/to/directory"));
    

提交回复
热议问题