title: S3 bucket name gets added to the S3 endpoint
body: <p>When trying to access a file from a S3 bucket using Scala, the bucket name gets added to the front of endpoint and the endpoint becomes wrong and in-accessible. </p>
  
  <p>Libraries:</p>
  
  <pre><code>libraryDependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.0"
  libraryDependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.0"
  libraryDependencies += "org.apache.hadoop" % "hadoop-aws" % "2.8.0"
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>sc.hadoopConfiguration.set("fs.s3a.endpoint", "[endpoint]")
  sc.textFile("s3a://[bucket_name]/testa.txt")
  </code></pre>