英文:
how to create a Folder inside a folder in java
问题
我曾试图查找同一Maven项目包中现有文件夹的路径,并从中创建另一个文件夹。
现有文件夹名为client101.userinfo。
我尝试过执行以下操作:
File dir = new File("client101.userinfo/userdat");
我做错了什么?
英文:
I have tried to find the path of an existing folder in the same maven project package and create another folder from it.
the existing folder is called client101.userinfo
i have tried to do:
File dir = new File("client101.userinfo/userdat");
what am I doing wrong?
答案1
得分: 0
你需要使用方法 mkdirs()
new File("/path/directory").mkdirs();
"directory" 是你想要创建的目录的名称。
英文:
You need to use method mkdirs()
new File("/path/directory").mkdirs();
"directory" is the name of the directory you want to create.
专注分享java语言的经验与见解,让所有开发者获益!
评论