Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1020320 // copyDirectory - ensures the dest doesn't exist yet [dev.]

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (1798L/12K).

svoid copyDirectory(File src, File dest) {
  if (dest.exists())
    fail("copyDirectory: " + f2s(dest) + " exists");
  if (sameCanonicalPath(src, dest))
    ret;
  if (inPhysicalSubdirectory(dest, src))
    fail("copyDirectory: " + canonicalPath(dest) + " is subdirectory of " + canonicalPath(src));
  dest.mkdirs();
  copyAllFilesInDirectory_rec_noOverwrite(src, dest);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1020320
Snippet name: copyDirectory - ensures the dest doesn't exist yet [dev.]
Eternal ID of this version: #1020320/3
Text MD5: 955b8b8b1d1c3d542f040ad7c3d5223d
Transpilation MD5: 7c92f0fec5c9ae9cde29cdb3ac76f4f1
Author: stefan
Category: javax / io
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-04 13:46:18
Source code size: 381 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 251 / 320
Version history: 2 change(s)
Referenced in: