File localFile = createTempDownloadFile();
if (localFile == null) {
throw new Exception("Failed to create tempory local file");
}
ProtocolManager protocolManager = getProtocolManager();
Protocol fromProtocol = protocolManager.getProtocolBySite(fromUri,
getAuthentication(fromUri), verifier);
if (fromProtocol == null) {
throw new Exception("Failed to get protocol for 'from' URI '"
+ fromUri + "'");
}
Protocol toProtocol = protocolManager.getProtocolBySite(toUri,
getAuthentication(toUri), verifier);
if (toProtocol == null) {
throw new Exception("Failed to get protocol for 'to' URI '" + toUri
+ "'");
}