}
@Override
public String createEntityExtractUrl(DataStore store, String installPath, ImageFormat format, DataObject dataObject) {
// find an endpoint to send command
EndPoint ep = _epSelector.select(store);
// Create Symlink at ssvm
String path = installPath;
String uuid = UUID.randomUUID().toString() + "." + format.getFileExtension();
CreateEntityDownloadURLCommand cmd = new CreateEntityDownloadURLCommand(((ImageStoreEntity) store).getMountPoint(), path, uuid, dataObject.getTO());
Answer ans = ep.sendMessage(cmd);
if (ans == null || !ans.getResult()) {
String errorString = "Unable to create a link for entity at " + installPath + " on ssvm," + ans.getDetails();
s_logger.error(errorString);
throw new CloudRuntimeException(errorString);
}
// Construct actual URL locally now that the symlink exists at SSVM
return generateCopyUrl(ep.getPublicAddr(), uuid);
}