Source:
<code>private DirectDownloadCommand getDirectDownloadCommandFromProtocol(DownloadProtocol protocol, String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> httpHeaders) { int connectTimeout = DEFAULT_DIRECT_DOWNLOAD_CONNECT_TIMEOUT; int soTimeout = DEFAULT_DIRECT_DOWNLOAD_SOCKET_TIMEOUT; int connectionRequestTimeout = DEFAULT_DIRECT_DOWNLOAD_CONNECTION_REQUEST_TIMEOUT; if (DownloadProtocol.HTTP.equals(protocol) || DownloadProtocol.HTTPS.equals(protocol) || DownloadProtocol.METALINK.equals(protocol)) { try { <START> connectTimeout = Integer.parseInt(configDao.getValue(DirectDownloadConnectTimeout.key())); <END> } catch (NumberFormatException nfe) { s_logger.warn(String.format("Unable to retrieve configuration: %s value", DirectDownloadConnectTimeout.key()), nfe); } try { soTimeout = Integer.parseInt(configDao.getValue(DirectDownloadSocketTimeout.key())); } catch (NumberFormatException nfe) { s_logger.warn(String.format("Unable to retrieve configuration: %s value", DirectDownloadSocketTimeout.key()), nfe); } } if (DownloadProtocol.HTTPS.equals(protocol)) { try { connectionRequestTimeout = Integer.parseInt(configDao.getValue(DirectDownloadConnectionRequestTimeout.key())); } catch (NumberFormatException nfe) { s_logger.warn(String.format("Unable to retrieve configuration: %s value", DirectDownloadConnectionRequestTimeout.key()), nfe); } } if (protocol.equals(DownloadProtocol.HTTP)) { return new HttpDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout); } else if (protocol.equals(DownloadProtocol.HTTPS)) { return new HttpsDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout, connectionRequestTimeout); } else if (protocol.equals(DownloadProtocol.NFS)) { return new NfsDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders); } else if (protocol.equals(DownloadProtocol.METALINK)) { return new MetalinkDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout); } else { return null; } }</code><technical_language>Please do this config key value() method,</technical_language>

Target:
private DirectDownloadCommand getDirectDownloadCommandFromProtocol(DownloadProtocol protocol, String url, Long templateId, PrimaryDataStoreTO destPool, String checksum, Map<String, String> httpHeaders) { int connectTimeout = DirectDownloadConnectTimeout.value(); int soTimeout = DirectDownloadSocketTimeout.value(); int connectionRequestTimeout = DirectDownloadConnectionRequestTimeout.value(); if (protocol.equals(DownloadProtocol.HTTP)) { return new HttpDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout); } else if (protocol.equals(DownloadProtocol.HTTPS)) { return new HttpsDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout, connectionRequestTimeout); } else if (protocol.equals(DownloadProtocol.NFS)) { return new NfsDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders); } else if (protocol.equals(DownloadProtocol.METALINK)) { return new MetalinkDirectDownloadCommand(url, templateId, destPool, checksum, httpHeaders, connectTimeout, soTimeout); } else { return null; } }