Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Expiration time not working #89

Open
nykolaslima opened this issue Jul 6, 2015 · 3 comments
Open

Expiration time not working #89

nykolaslima opened this issue Jul 6, 2015 · 3 comments

Comments

@nykolaslima
Copy link

I'm trying to upload a file and set a expiration time to it.

    val metadata: ObjectMetadata = new ObjectMetadata()
    metadata.setContentLength(file.length)
    metadata.setExpirationTime(DateTime.now().plusMinutes(10).toDate)

    bucket.get.putObjectAsPublicRead(filename, file, metadata)

But when I check the file in the s3 bucket it doesn't have expiry date. It's some bug in AWScala or am I using it wrong?

@seratch
Copy link
Owner

seratch commented Jul 13, 2015

It's some bug in AWScala or am I using it wrong?

I'm not sure. Please figure out the cause if you have time.

@nykolaslima
Copy link
Author

I need to debug it. But looks like a bug in AWScala

@orium
Copy link

orium commented Jun 22, 2018

This does not seem to be a bug in AWScala but a very poorly designed AWS SDK:

    /**
     * For internal use only. This will *not* set the object's expiration time,
     * and is only used to set the value in the object after receiving the value
     * in a response from S3.
     *
     * @param expirationTime
     *            The expiration time for the object.
     */
    public void setExpirationTime(Date expirationTime) {
        this.expirationTime = expirationTime;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants