How to create a file — including folders — for a given path?

后端 未结 5 1372
旧时难觅i
旧时难觅i 2021-02-04 23:27

Am downloading a zip file from web. It contain folders and files. Uncompressing them using ZipInputstream and ZipEntry. Zipentry.getName

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-05 00:07

    You can use Google's guava library to do it in a couple of lines with Files class:

    Files.createParentDirs(file);
    Files.touch(file);
    

    https://code.google.com/p/guava-libraries/

提交回复
热议问题