public java.net.URI copyAndRegisterFile(java.net.URI source, java.net.URI dest, java.net.URI logicalName, java.lang.String protocol, int nstreams)
This method performs the task of copying a file into grid-aware storage and registering the copy in the Replica Catalog as an atomic operation. This is the preferred method to `bring files into the grid'.
The same could be done by issuing copyFile and registerFile in sequence, but since copyFile may not have an SE or SURL as its destination, the user would need to specify a valid transport file name (using gridftp for example) to a location that happens to be the proper location for the file and then register it using registerFile. That is much more error prone and cumbersome than this method. As a rule, copyFile should be used to copy files around to non-grid aware storage, or to simply copy files out of the grid (i.e. the source may be grid-aware but not the destination).
registerFile should be used to register files that are already in the grid-aware store before it was made grid-aware or to register files that appear there through other means (like new data files). If the files that need to be put into the grid are not yet in their grid-aware location, copyAndRegisterFile is the most robust method to use.