/** * Copies this to dest. Overwrites existing file and adds to existing directories. * * @throws NodeNotFoundException if this does not exist */ public void copy(Node dest) throws NodeNotFoundException, CopyException { try { if (isDirectory()) { dest.mkdirOpt(); copyDirectory(dest); } else { copyFile(dest); } } catch (FileNotFoundException | CopyException e) { throw e; } catch (IOException e) { throw new CopyException(this, dest, e); } }