kaliber-scala / play-s3

S3 module for Play
MIT License
119 stars 49 forks source link

`putCopy` is not exposed in high-level operations #58

Closed raphael-proust closed 8 years ago

raphael-proust commented 9 years ago

The ability to copy files is useful. Unfortunately, there's no high-level operation for copying files from s3 to s3.

EECOLOR commented 9 years ago

What would be your suggestion?

raphael-proust commented 9 years ago

Add something similar to what is below to the Bucket.scala file. Thus allowing Bucket copy(src,dst).

  /**
   * Allows you to copy a file within this bucket.
   *
   * @param sourceItemName          The old name of the item
   * @param destinationItemName     The new name of the item
   * @param acl                 The ACL for the new item, default is PUBLIC_READ
   */
  def copy(sourceItemName: String, destinationItemName: String, acl: ACL = PUBLIC_READ, headers: Map[String, String] = Map.empty): Future[Unit] = {
    s3.putCopy(name, sourceItemName, name, destinationItemName, acl, headers) map unitResponse
  }