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

后端 未结 5 1272
旧时难觅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

    Looks at the file you use the .mkdirs() method on a File object: http://www.roseindia.net/java/beginners/java-create-directory.shtml

            isDirectoryCreated = (new File("../path_for_Directory/Directory_Name")).mkdirs();
            if (!isDirectoryCreated) 
            {
                // Directory creation failed
            }
    

提交回复
热议问题