mirror of https://github.com/sbt/sbt.git
Address deprecation warning
This commit is contained in:
parent
90f44bc5cc
commit
f8c75d7033
|
|
@ -3,7 +3,7 @@ package lmcoursier.internal
|
|||
import java.io.{File, FileNotFoundException, IOException}
|
||||
import java.net.{HttpURLConnection, URL, URLConnection}
|
||||
|
||||
import coursier.cache.{CacheUrl, FileCache}
|
||||
import coursier.cache.{ConnectionBuilder, FileCache}
|
||||
import coursier.core._
|
||||
import coursier.util.{Artifact, EitherT, Monad}
|
||||
|
||||
|
|
@ -54,16 +54,14 @@ object TemporaryInMemoryRepository {
|
|||
|
||||
var conn: URLConnection = null
|
||||
try {
|
||||
conn = CacheUrl.urlConnection(
|
||||
url.toString,
|
||||
None,
|
||||
followHttpToHttpsRedirections = cacheOpt.fold(false)(_.followHttpToHttpsRedirections),
|
||||
followHttpsToHttpRedirections = cacheOpt.fold(false)(_.followHttpsToHttpRedirections),
|
||||
sslSocketFactoryOpt = cacheOpt.flatMap(_.sslSocketFactoryOpt),
|
||||
hostnameVerifierOpt = cacheOpt.flatMap(_.hostnameVerifierOpt),
|
||||
method = "HEAD",
|
||||
maxRedirectionsOpt = cacheOpt.flatMap(_.maxRedirections)
|
||||
)
|
||||
conn = ConnectionBuilder(url.toURI.toASCIIString)
|
||||
.withFollowHttpToHttpsRedirections(cacheOpt.fold(false)(_.followHttpToHttpsRedirections))
|
||||
.withFollowHttpsToHttpRedirections(cacheOpt.fold(false)(_.followHttpsToHttpRedirections))
|
||||
.withSslSocketFactoryOpt(cacheOpt.flatMap(_.sslSocketFactoryOpt))
|
||||
.withHostnameVerifierOpt(cacheOpt.flatMap(_.hostnameVerifierOpt))
|
||||
.withMethod("HEAD")
|
||||
.withMaxRedirectionsOpt(cacheOpt.flatMap(_.maxRedirections))
|
||||
.connection()
|
||||
// Even though the finally clause handles this too, this has to be run here, so that we return Some(true)
|
||||
// iff this doesn't throw.
|
||||
conn.getInputStream.close()
|
||||
|
|
|
|||
Loading…
Reference in New Issue