Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add parentheses. prepare sbt 2.x #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading