All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.netaporter.uri.inet.PublicSuffixes.scala Maven / Gradle / Ivy

The newest version!
package com.netaporter.uri.inet

import spray.json.DefaultJsonProtocol._
import spray.json.{JsonFormat, _}

import scala.io.Source

object PublicSuffixes {
  lazy val trie = {
    implicit lazy val trieFmt: JsonFormat[Trie] = lazyFormat(jsonFormat(Trie, "c", "e"))
    val trieJson = Source.fromURL(getClass.getResource("/public_suffix_trie.json"), "UTF-8")
    val trie = trieJson.mkString.parseJson.convertTo[Trie]
    trieJson.close()
    trie
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy