Skip to content

Commit

Permalink
add parentheses. prepare sbt 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Oct 7, 2024
1 parent aff89af commit 786501d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/fm/sbt/S3URLHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ object S3URLHandler {
val cname: Option[String] = try {
val attrs: Attributes = dnsContext.getAttributes(host, Array("CNAME"))
Option(attrs.get("CNAME"))
.flatMap{ attr: Attribute => Option(attr.get) }
.flatMap{ (attr: Attribute) => Option(attr.get) }
.collectFirst{ case res: String => res }
} catch {
case _: NamingException => None
Expand Down Expand Up @@ -378,7 +378,7 @@ final class S3URLHandler extends URLHandler {

val keys: Seq[String] = listing.getCommonPrefixes.asScala ++ listing.getObjectSummaries.asScala.map{ _.getKey }

val res: Seq[URL] = keys.map{ k: String =>
val res: Seq[URL] = keys.map{ (k: String) =>
new URL(url.toString.stripSuffix("/") + "/" + k.stripPrefix(prefix))
}

Expand Down Expand Up @@ -494,7 +494,7 @@ final class S3URLHandler extends URLHandler {
def getBucketAndKey(url: URL): (String, String) = {
// The AmazonS3URI constructor should work for standard S3 urls. But if a custom domain is being used
// (e.g. snapshots.maven.frugalmechanic.com) then we treat the hostname as the bucket and the path as the key
getAmazonS3URI(url).map{ amzn: AmazonS3URI =>
getAmazonS3URI(url).map{ (amzn: AmazonS3URI) =>
(amzn.getBucket, amzn.getKey)
}.getOrElse {
// Probably a custom domain name - The host should be the bucket and the path the key
Expand Down

0 comments on commit 786501d

Please sign in to comment.