简体   繁体   中英

how to create a Folder inside a folder in java

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?

You need to use method mkdirs()

new File("/path/directory").mkdirs();

"directory" is the name of the directory 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM