No easy way to copy directory

I didn't find one convenient way to copy a directory recursively. Have to execute a 'cp -r' command on Ubuntu,
Could you provide some better APIs for manupulating files.
Could you provide some better APIs for manupulating files.