Break your path into bucket and object.
Testing the bucket using the method doesBucketExist
,
Testing the object using the size of the listing (0 in case not exist).
So this code will do:
String bucket = ...;
String objectInBucket = ...;
AmazonS3 s3 = new AmazonS3Client(...);
return s3.doesBucketExist(bucket)
&& !s3.listObjects(bucket, objectInBucket).getObjectSummaries().isEmpty();