From 015de70bd61369b9312434082f52e452377b1172 Mon Sep 17 00:00:00 2001 From: Anderson Keiji Matsuki Ito Date: Sun, 4 Feb 2024 14:51:16 +0100 Subject: [PATCH] Remove unused import --- .../scala/org/codecraftlabs/spark/utils/RestUtils.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/scala/org/codecraftlabs/spark/utils/RestUtils.scala b/src/main/scala/org/codecraftlabs/spark/utils/RestUtils.scala index 94b3fd1..3a54bff 100644 --- a/src/main/scala/org/codecraftlabs/spark/utils/RestUtils.scala +++ b/src/main/scala/org/codecraftlabs/spark/utils/RestUtils.scala @@ -1,6 +1,6 @@ package org.codecraftlabs.spark.utils -import scala.io +import scala.io.Source object RestUtils { @throws(classOf[java.io.IOException]) @@ -11,14 +11,14 @@ object RestUtils { requestMethod: String = "GET", requestHeaders: Map[String, String] = Map()): String = { - import java.net.{URL, HttpURLConnection} + import java.net.{HttpURLConnection, URL} val connection = new URL(url).openConnection.asInstanceOf[HttpURLConnection] requestHeaders.foreach(item => connection.setRequestProperty(item._1, item._2)) connection.setConnectTimeout(connectTimeout) connection.setReadTimeout(readTimeout) connection.setRequestMethod(requestMethod) val inputStream = connection.getInputStream - val content = io.Source.fromInputStream(inputStream).mkString + val content = Source.fromInputStream(inputStream).mkString if (inputStream != null) inputStream.close() content }