try {
if (headOnly) {
if (signedGetOrHeadUrl == null) {
result = s3Service.getObjectDetails(bucket, objectKey);
} else {
SignedUrlHandler handler = s3Service;
result = handler.getObjectDetailsWithSignedUrl(signedGetOrHeadUrl);
}
} else {
if (signedGetOrHeadUrl == null) {
result = s3Service.getObject(bucket, objectKey);
} else {
SignedUrlHandler handler = s3Service;
result = handler.getObjectWithSignedUrl(signedGetOrHeadUrl);
}
}
} catch (ServiceException se) {
result = new S3ServiceException(se);
}