File tree Expand file tree Collapse file tree 3 files changed +34
-11
lines changed
gxcloudstorage-awss3-v1/src/main/java/com/genexus/db/driver
gxcloudstorage-awss3-v2/src/main/java/com/genexus/db/driver Expand file tree Collapse file tree 3 files changed +34
-11
lines changed Original file line number Diff line number Diff line change @@ -337,12 +337,20 @@ public String getDirectory(String directoryName) {
337
337
}
338
338
339
339
public boolean existsDirectory (String directoryName ) {
340
- ListObjectsV2Request listObjectsRequest = new ListObjectsV2Request ()
340
+ if (directoryName == null || directoryName .isEmpty () || directoryName .equals ("." ) || directoryName .equals ("/" ))
341
+ directoryName = "" ;
342
+ else
343
+ directoryName = StorageUtils .normalizeDirectoryName (directoryName );
344
+
345
+ ListObjectsV2Request listObjectsV2Request = new ListObjectsV2Request ()
341
346
.withBucketName (bucket )
342
- .withDelimiter (StorageUtils .DELIMITER )
343
- .withPrefix (StorageUtils .normalizeDirectoryName (directoryName ))
347
+ .withPrefix (directoryName )
344
348
.withMaxKeys (1 );
345
- return client .listObjectsV2 (listObjectsRequest ).getKeyCount () > 0 ;
349
+
350
+ if (!directoryName .isEmpty ())
351
+ listObjectsV2Request = listObjectsV2Request .withDelimiter (StorageUtils .DELIMITER );
352
+
353
+ return client .listObjectsV2 (listObjectsV2Request ).getKeyCount () > 0 ;
346
354
}
347
355
348
356
public void createDirectory (String directoryName ) {
Original file line number Diff line number Diff line change @@ -515,12 +515,27 @@ public String getDirectory(String directoryName) {
515
515
}
516
516
517
517
public boolean existsDirectory (String directoryName ) {
518
- ListObjectsV2Request listObjectsRequest = ListObjectsV2Request .builder ()
519
- .bucket (bucket )
520
- .delimiter (StorageUtils .DELIMITER )
521
- .prefix (StorageUtils .normalizeDirectoryName (directoryName ))
522
- .maxKeys (1 )
523
- .build ();
518
+ if (directoryName == null || directoryName .isEmpty () || directoryName .equals ("." ) || directoryName .equals ("/" ))
519
+ directoryName = "" ;
520
+ else
521
+ directoryName = StorageUtils .normalizeDirectoryName (directoryName );
522
+
523
+
524
+ ListObjectsV2Request listObjectsRequest ;
525
+ if (!directoryName .isEmpty ())
526
+ listObjectsRequest = ListObjectsV2Request .builder ()
527
+ .bucket (bucket )
528
+ .prefix (directoryName )
529
+ .maxKeys (1 )
530
+ .delimiter (StorageUtils .DELIMITER )
531
+ .build ();
532
+ else
533
+ listObjectsRequest = ListObjectsV2Request .builder ()
534
+ .bucket (bucket )
535
+ .prefix (directoryName )
536
+ .maxKeys (1 )
537
+ .build ();
538
+
524
539
return client .listObjectsV2 (listObjectsRequest ).keyCount () > 0 ;
525
540
}
526
541
Original file line number Diff line number Diff line change 42
42
<dependency >
43
43
<groupId >org.libreoffice</groupId >
44
44
<artifactId >libreoffice</artifactId >
45
- <version >7.5.1 </version >
45
+ <version >7.5.9 </version >
46
46
</dependency >
47
47
</dependencies >
48
48
You can’t perform that action at this time.
0 commit comments