How to deal with files

xiaoxiao2021-03-06  39

Reference address http://javaalmanac.com/egs/java.io/pkg.html#files

// Copies all files under srcDir to dstDir.// If dstDir does not exist, it will be created.public void copyDirectory (File srcDir, File dstDir) throws IOException {if (srcDir.isDirectory ()) {if (! DstDir. EXISTS ()) {dstdir.mkdir ();} String [] children = srcdir.list (); for (int i = 0; i 0) {Out.write (buf, 0, len);} in.close (); OUT.CLOSE ();} =========================================== ==

转载请注明原文地址:https://www.9cbs.com/read-73453.html

New Post(0)