Java's createNewFile() - will it also create directories?

后端 未结 6 847
野趣味
野趣味 2020-12-13 08:20

I\'ve got a conditional to check if a certain file exists before proceeding (./logs/error.log). If it isn\'t found I want to create it. However, will

         


        
6条回答
  •  感情败类
    2020-12-13 08:36

    StringUtils.touch(/path/filename.ext) will now (>=1.3) also create the directory and file if they don't exist.

提交回复
热议问题