I'm trying to delete a file from bucket using following code. but I can still view the file via browser
if (isValidFile(s3Client, BucketName, keyName)) {
try{
s3Client.deleteObject(new DeleteObjectRequest(BucketName,keyName));
}catch(Exception e){
e.printStackTrace();
}}
Why is delete not working??