Skip to content

Commit

Permalink
Use scala.jdk.CollectionConverters
Browse files Browse the repository at this point in the history
  • Loading branch information
rtyley committed Jan 31, 2024
1 parent 08d803e commit e71c657
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/controllers/Api.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import play.api.libs.json._
import play.api.mvc._

import scala.concurrent.Future
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class Api(
override val stores: DataStores,
Expand Down
2 changes: 1 addition & 1 deletion app/model/YouTubeMessage.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package model
import com.gu.media.logging.Logging
import net.logstash.logback.marker.Markers

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class YouTubeMessage(atomId: String, videoId: String, reason: String, message: String, isError: Boolean = false) extends Logging {

Expand Down
2 changes: 1 addition & 1 deletion app/model/commands/CommandException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.google.api.client.googleapis.json.{GoogleJsonError, GoogleJsonRespons
import com.google.api.client.http.{HttpHeaders, HttpResponseException}
import com.gu.media.logging.Logging
import play.api.mvc.{Result, Results}
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class CommandException(msg: String, responseCode: Int) extends RuntimeException(msg)

Expand Down
2 changes: 1 addition & 1 deletion app/model/commands/DeleteAssetCommand.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import data.DataStores
import model.commands.CommandExceptions._
import net.logstash.logback.marker.{LogstashMarker, Markers}
import util.AWSConfig
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class DeleteAssetCommand(
atomId: String,
Expand Down
2 changes: 1 addition & 1 deletion app/util/AWS.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.gu.media.aws._
import com.gu.media.logging.{Logging}
import com.typesafe.config.Config

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class AWSConfig(override val config: Config, override val credentials: AwsCredentials)
extends Settings
Expand Down
2 changes: 1 addition & 1 deletion app/util/PlutoMessageConsumer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.amazonaws.services.sqs.model.{DeleteMessageRequest, ReceiveMessageReq
import scala.concurrent.ExecutionContext
import com.gu.media.logging.Logging
import data.DataStores
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import play.api.libs.json._

case class PlutoMessageConsumer(val stores: DataStores, awsConfig: AWSConfig)
Expand Down
2 changes: 1 addition & 1 deletion app/util/StepFunctions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.fasterxml.jackson.core.JsonParseException
import com.gu.media.upload.model._
import play.api.libs.json.{JsResultException, Json}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class StepFunctions(awsConfig: AWSConfig) {
def getById(id: String): Option[Upload] = {
Expand Down
2 changes: 1 addition & 1 deletion app/util/Transcoder.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package util
import com.amazonaws.services.elastictranscoder.model.ListJobsByPipelineRequest
import model.transcoder.JobStatus

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import java.time.Duration

class Transcoder(awsConfig: AWSConfig) {
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/com/gu/media/Settings.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.gu.media

import com.typesafe.config.Config
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

trait Settings {
def config: Config
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/com/gu/media/aws/UploadAccess.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.amazonaws.services.stepfunctions.AWSStepFunctionsClientBuilder
import com.amazonaws.services.stepfunctions.model.ListStateMachinesRequest
import com.gu.media.Settings

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

trait UploadAccess { this: Settings with AwsAccess =>
val userUploadBucket: String = getMandatoryString("aws.upload.bucket")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import enumeratum.EnumEntry.Hyphencase
import enumeratum.{Enum, EnumEntry}
import net.logstash.logback.marker.{LogstashMarker, Markers}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

sealed trait YoutubeApiType extends EnumEntry with Hyphencase

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.gu.media.model;
import com.gu.media.logging.Logging
import net.logstash.logback.marker.Markers

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

case class AuditMessage(atomId: String, auditType: String, user: String, description: Option[String] = None) extends Logging{

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/com/gu/media/util/MAMLogger.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.gu.media.util
import com.gu.media.logging.Logging
import net.logstash.logback.marker.Markers

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

object MAMLogger extends Logging {
private def atomIdMarker(atomId: String) = Map("atomId" -> atomId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.gu.media.logging.{Logging, YoutubeApiType, YoutubeRequestLogger, Yout
import net.logstash.logback.marker.{LogstashMarker, Markers}

import java.io.FileInputStream
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

trait YouTubeAccess extends Settings with Logging {
def appName: String = getMandatoryString("name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.gu.media.logging.{Logging, YoutubeApiType, YoutubeRequestLogger, Yout
import com.gu.media.model.{AdSettings, VideoUpdateError}
import com.gu.media.util.MAMLogger

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

//This class contains functionality to add usage policies to published videos.
//Videos are either tracked or monetized: https://support.google.com/youtube/answer/107383?hl=en-GB
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.gu.media.model.VideoUpdateError
import com.gu.media.util.ISO8601Duration
import com.gu.media.logging.{YoutubeApiType, YoutubeRequestLogger, YoutubeRequestType}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

trait YouTubeVideos { this: YouTubeAccess with Logging =>
def getVideo(youtubeId: String, part: String): Option[Video] = {
Expand Down
2 changes: 1 addition & 1 deletion common/src/main/scala/com/gu/media/youtube/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.gu.media.util.ISO8601Duration
import play.api.libs.functional.syntax._
import play.api.libs.json._

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._
import org.joda.time.DateTime
import com.gu.media.util.JsonDate._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.gu.media.logging.Logging
import com.gu.media.upload.model.{CopyETag, CopyProgress, Upload}

import scala.util.control.NonFatal
import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class CompleteMultipartCopy extends LambdaWithParams[Upload, Upload] with S3Access with Logging {
override def handle(upload: Upload) = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.gu.media.lambda.LambdaWithParams
import com.gu.media.logging.Logging
import com.gu.media.upload.model.{SelfHostedUploadMetadata, Upload}

import scala.collection.JavaConverters._
import scala.jdk.CollectionConverters._

class GetTranscodingProgress extends LambdaWithParams[Upload, Upload] with ElasticTranscodeAccess with Logging {
override def handle(upload: Upload): Upload = {
Expand Down

0 comments on commit e71c657

Please sign in to comment.