JsResource

eu.joaocosta.minart.backend.JsResource
final case class JsResource(resourcePath: String) extends Resource

Resource loader that fetches resources using a XML HTTP Request.

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Resource
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

Path to the resource

Path to the resource

Attributes

def unsafeInputStream(): InputStream

Loads the resource synchronously, and returns an java.io.InputStream. The InputStream is NOT closed in the end.

Loads the resource synchronously, and returns an java.io.InputStream. The InputStream is NOT closed in the end.

This method should only be used if for some reason the input stream must stay open (e.g. for data streaming)

Attributes

def unsafeOutputStream(): OutputStream

Loads the resource synchronously, and returns an java.io.OutputStream. The OutputStream is NOT closed in the end.

Loads the resource synchronously, and returns an java.io.OutputStream. The OutputStream is NOT closed in the end.

This method should only be used if for some reason the output stream must stay open (e.g. for data streaming)

Attributes

def withInputStreamAsync[A](f: InputStream => A): Future[A]

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource asynchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Attributes

override def withSource[A](f: Source => A): Try[A]

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

Loads the resource synchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStream instead.

Attributes

Definition Classes
Resource
def withSourceAsync[A](f: Source => A): Future[A]

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Loads the resource asynchronously, processes the contents using a scala.io.Source and returns the result. The Source is closed in the end, so it should not escape this call. For working with binary files, it is recommended to use withInputStreamAsync instead.

Attributes

Inherited methods

Checks if the resource exists

Checks if the resource exists

Attributes

Inherited from:
Resource

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def withInputStream[A](f: InputStream => A): Try[A]

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Loads the resource synchronously, processes the contents using a java.io.InputStream and returns the result. The InputStream is closed in the end, so it should not escape this call.

Attributes

Inherited from:
Resource
def withOutputStream[A](f: OutputStream => A): Try[A]

Provides a java.io.OutputStream to write data to this resource location. The OutputStream is closed in the end, so it should not escape this call.

Provides a java.io.OutputStream to write data to this resource location. The OutputStream is closed in the end, so it should not escape this call.

Attributes

Inherited from:
Resource