Trait/Object

com.zengularity.benji

ObjectRef

Related Docs: object ObjectRef | package benji

Permalink

trait ObjectRef extends AnyRef

A live reference to a storage object. The operations are scoped on the specified object.

Such reference must only be used with the storage which resolved it first.

Self Type
ObjectRef
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ObjectRef
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. trait DeleteRequest extends AnyRef

    Permalink

    A request to delete the bucket.

  2. trait GetRequest extends AnyRef

    Permalink

    A GET request.

  3. trait PutRequest[E, A] extends AnyRef

    Permalink

    A PUT request: allows you to update the contents of this object.

    A PUT request: allows you to update the contents of this object.

    E

    the consumer input type

    A

    the consumer output type

Abstract Value Members

  1. abstract def bucket: String

    Permalink

    The name of parent bucket.

  2. abstract def copyTo(targetBucketName: String, targetObjectName: String)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Copies the referenced object to another one.

    Copies the referenced object to another one.

    targetBucketName

    the name of the parent bucket for the target object

    targetObjectName

    the name of the target object

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.copyTo("targetBucket", "copyName")
  3. abstract def defaultThreshold: Bytes

    Permalink

    The default threshold for multipart (multi-component) upload.

  4. abstract def delete: DeleteRequest

    Permalink

    Prepares a request to delete the referenced object.

    Prepares a request to delete the referenced object.

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.delete()
  5. abstract def exists(implicit ec: ExecutionContext): Future[Boolean]

    Permalink

    Checks whether or not this object exists.

    Checks whether or not this object exists. May also return false in cases you don't have permission to view a certain object.

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.exists
  6. abstract def get: GetRequest

    Permalink

    Prepares the request to get the contents of this object.

    Prepares the request to get the contents of this object.

    import akka.stream.Materializer
    import com.zengularity.benji.ObjectRef
    
    def foo(myObject: ObjectRef)(implicit m: Materializer) =
      myObject.get()
  7. abstract def headers()(implicit ec: ExecutionContext): Future[Map[String, Seq[String]]]

    Permalink

    Returns the headers associated with the currently referenced object.

    Returns the headers associated with the currently referenced object.

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.headers()
  8. abstract def metadata()(implicit ec: ExecutionContext): Future[Map[String, Seq[String]]]

    Permalink

    Returns the metadata associated with the currently referenced object (normalized from the headers).

    Returns the metadata associated with the currently referenced object (normalized from the headers).

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.metadata()
  9. abstract def moveTo(targetBucketName: String, targetObjectName: String, preventOverwrite: Boolean)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Moves the referenced object to another one.

    Moves the referenced object to another one. If fails, the current object is still available.

    targetBucketName

    the name of the parent bucket for the target object

    targetObjectName

    the name of the target object

    preventOverwrite

    if true, prevents overwriting an existing target object

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    def foo(myObject: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.moveTo("targetBucket", "newName", false)
  10. abstract def name: String

    Permalink

    The name of the object itself.

  11. abstract def put[E, A]: PutRequest[E, A]

    Permalink

    E

    the consumer input type

    A

    the consumer output type

    import akka.util.ByteString
    import akka.stream.Materializer
    import play.api.libs.ws.BodyWritable
    import scala.concurrent.Future
    import com.zengularity.benji.ObjectRef
    def upload(obj: ObjectRef)(
      implicit m: Materializer, w: BodyWritable[ByteString]) =
      obj.put[ByteString, Unit]({})((_, _) => Future.successful({}))
  12. abstract def versioning: Option[ObjectVersioning]

    Permalink

    Try to get a reference of this object that would allow you to perform versioning related operations.

    Try to get a reference of this object that would allow you to perform versioning related operations.

    returns

    Some if the module of the object supports versioning related operations, otherwise None.

    def foo(myObject: com.zengularity.benji.ObjectRef) =
      myObject.versioning.isDefined

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def copyTo(target: ObjectRef)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Copies the referenced object to another one.

    Copies the referenced object to another one.

    target

    the reference to the target object

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    def foo(
      myObject: ObjectRef,
      otherRef: ObjectRef)(implicit ec: ExecutionContext) =
      myObject.copyTo(otherRef)
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. final def moveTo(target: ObjectRef, preventOverwrite: Boolean = true)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Moves the referenced object to another one.

    Moves the referenced object to another one. If fails, the current object is still available.

    target

    the reference to the target object

    preventOverwrite

    if true, prevents overwriting an existing target object (default: true)

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.ObjectRef
    def foo(
      myObject: ObjectRef, otherRef: ObjectRef)(
      implicit ec: ExecutionContext) = myObject.moveTo(otherRef)
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def put[E](size: Long)(implicit m: Materializer, w: BodyWritable[E]): Sink[E, Future[NotUsed]]

    Permalink

    E

    the consumer input type

    size

    the total size in bytes to be PUTed

  18. def put[E](implicit m: Materializer, w: BodyWritable[E]): Sink[E, Future[NotUsed]]

    Permalink

    E

    the consumer input type

  19. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  20. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped