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

com.malliina.push.mpns.MPNSToken.scala Maven / Gradle / Ivy

There is a newer version: 1.24.4
Show newest version
package com.malliina.push.mpns

import java.net.URL

import com.malliina.push.{Token, TokenCompanion}

import scala.util.Try

case class MPNSToken private (token: String) extends AnyVal with Token

object MPNSToken extends TokenCompanion[MPNSToken] {
  override def isValid(token: String): Boolean =
    toUrl(token).isSuccess

  def toUrl(in: String): Try[URL] =
    Try(new URL(in)).filter(_.getPath.length > 0)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy