File destFile = new File(filePath + File.separator + name);
if (!destFile.createNewFile()) {
s_logger.warn("Reusing existing file " + destFile.getPath());
}
FileOutputStream outputStream = new FileOutputStream(destFile);
entity.writeTo(outputStream);
return new File(destFile.getAbsolutePath());
} catch (IOException e) {
s_logger.debug("Faild to get url:" + url + ", due to " + e.toString());
throw new CloudRuntimeException(e);
}