athrog commented on a change in pull request #271:
URL: https://github.com/apache/solr/pull/271#discussion_r695972996



##########
File path: 
solr/contrib/s3-repository/src/java/org/apache/solr/s3/S3StorageClient.java
##########
@@ -253,17 +256,20 @@ void deleteDirectory(String path) throws S3Exception {
    * @return true if path exists, otherwise false?
    */
   boolean pathExists(String path) throws S3Exception {
-    path = sanitizedPath(path);
+    final String s3Path = sanitizedPath(path);
 
     // for root return true
-    if (path.isEmpty() || S3_FILE_PATH_DELIMITER.equals(path)) {
+    if (s3Path.isEmpty() || S3_FILE_PATH_DELIMITER.equals(s3Path)) {
       return true;
     }
 
     try {
-      return s3Client.doesObjectExist(bucketName, path);
-    } catch (AmazonClientException ase) {
-      throw handleAmazonException(ase);
+      s3Client.headObject(builder -> builder.bucket(bucketName).key(s3Path));

Review comment:
       I remember seeing this in the API last I looked -- no first class 
support for object existence :(




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to