AWScala icon indicating copy to clipboard operation
AWScala copied to clipboard

Cannot set object metadata

Open e-dorigatti opened this issue 9 years ago • 0 comments

Hello, my objects are created with the wrong content-type and I'd like to change that. The code runs fine and gives no errors, still the metadata is not changed. Here's my code, note that setAsPublicRead works and keys are indeed publicly accessible.

case Some(key) =>
          key.setAsPublicRead()

          key.metadata.setContentType("text/plain")

          val meta = key.getObjectMetadata
          meta.setContentType("text/plain")

          val userMeta = new java.util.HashMap[String, String]
          userMeta.put("test-key", "test-value")
          meta.setUserMetadata(userMeta)

          key.setObjectMetadata(meta)

Issue #89 might be related

e-dorigatti avatar Aug 28 '15 11:08 e-dorigatti