JavaResource

final case class JavaResource(resourcePath: String) extends Resource

Resource loader by first trying to access the jar's resources. If that fails, it tries to fetch the data from a file.

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

Value members

Concrete methods

override def exists(): Boolean
Definition Classes
Resource
def unsafeInputStream(): InputStream
def unsafeOutputStream(): OutputStream
def withInputStreamAsync[A](f: InputStream => A): Future[A]
def withSourceAsync[A](f: Source => A): Future[A]

Inherited methods

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.

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

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.

Inherited from:
Resource
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.

Inherited from:
Resource