I need to move a file from one directory to another in the android filesystem. How can I programmatically check if the two paths is on the same mountpoint?

The reason I want to know this is because if they are, we need to copy the bits instead of using [File.rename(newPath)](http://developer.android.com/reference/java/io/File.html#renameTo(java.io.File)).

Examples when the paths is on different mountpoints:

* The user wants to move a file from the internal to external storage.
* The user wants to move a file from /sdcard/files to /sdcard/external\_sd/files on a samsungdevice.