// Groovy Version: 2.4.11 JVM: 1.8.0_144 Vendor: Oracle Corporation OS: Mac OS X
@Grab('com.amazonaws:aws-java-sdk-s3:1.11.184')
import com.amazonaws.regions.Regions
import com.amazonaws.services.s3.AmazonS3
import com.amazonaws.services.s3.AmazonS3ClientBuilder
AmazonS3 s3Client = AmazonS3ClientBuilder.standard()
.withRegion(Regions.AP_NORTHEAST_1)
.build()
def bucketName = 'your-bucket-name'
def key = 'some/s3/key'
println s3Client.doesObjectExist(bucketName, key)
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme