How to create a directory and sub directory structure with java?

后端 未结 5 1433
忘了有多久
忘了有多久 2020-12-29 05:39

Hello there I want to create the directories and sub directories with the java. My directory structure is starts from the current application directory, Means in current pro

5条回答
  •  猫巷女王i
    2020-12-29 06:38

    You can create all parent directories by using File.mkdirs().

    File.mkdirs() - Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories. Note that if this operation fails it may have succeeded in creating some of the necessary parent directories.

提交回复
热议问题