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

sttp.client3.internal.SttpFileExtensions.scala Maven / Gradle / Ivy

package sttp.client3.internal

import org.scalajs.dom.File

// wrap a DomFile
trait SttpFileExtensions { self: SttpFile =>

  def toDomFile: File = underlying.asInstanceOf[File]

  def readAsString: String = throw new UnsupportedOperationException()
  def readAsByteArray: Array[Byte] = throw new UnsupportedOperationException()
}

trait SttpFileCompanionExtensions {
  def fromDomFile(file: File): SttpFile =
    new SttpFile(file) {
      val name: String = file.name
      val size: Long = file.size.toLong
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy