How to check if a specified key exists in a given S3 bucket using Java

in His Steps picture in His Steps · Nov 28, 2011 · Viewed 133.3k times · Source

I would like to check if a key exists in a given bucket using Java. I looked at the API but there aren't any methods that are useful. I tried to use getObject but it threw an exception.

Answer

malana picture malana · Apr 15, 2016

There's now a doesObjectExist method in the official Java API.

Enjoy!