@Test void isEmptyDryRunForOtherHighLevelDirectory() { amazonS3.putObject(bucket, "table/partition_2", content); boolean result = s3ClientDryRun.isEmpty(bucket, "table", keyRoot); assertThat(result).isFalse(); }
boolean isEmpty(String bucket, String key, String leafKey) { List<S3ObjectSummary> objectsLeftAtPath = amazonS3.listObjectsV2(bucket, key + "/").getObjectSummaries(); if (!dryRunEnabled) { return objectsLeftAtPath.size() == 0; } else { String leafKeySentinel = leafKey + S3SentinelFilesCleaner.SENTINEL_SUFFIX; for (S3ObjectSummary s3ObjectSummary : objectsLeftAtPath) { String currentKey = s3ObjectSummary.getKey(); if (!currentKey.startsWith(leafKey + "/") && !currentKey.equals(leafKeySentinel)) { return false; } } return true; } }
S3Client { boolean isEmpty(String bucket, String key, String leafKey) { List<S3ObjectSummary> objectsLeftAtPath = amazonS3.listObjectsV2(bucket, key + "/").getObjectSummaries(); if (!dryRunEnabled) { return objectsLeftAtPath.size() == 0; } else { String leafKeySentinel = leafKey + S3SentinelFilesCleaner.SENTINEL_SUFFIX; for (S3ObjectSummary s3ObjectSummary : objectsLeftAtPath) { String currentKey = s3ObjectSummary.getKey(); if (!currentKey.startsWith(leafKey + "/") && !currentKey.equals(leafKeySentinel)) { return false; } } return true; } } }
S3Client { boolean isEmpty(String bucket, String key, String leafKey) { List<S3ObjectSummary> objectsLeftAtPath = amazonS3.listObjectsV2(bucket, key + "/").getObjectSummaries(); if (!dryRunEnabled) { return objectsLeftAtPath.size() == 0; } else { String leafKeySentinel = leafKey + S3SentinelFilesCleaner.SENTINEL_SUFFIX; for (S3ObjectSummary s3ObjectSummary : objectsLeftAtPath) { String currentKey = s3ObjectSummary.getKey(); if (!currentKey.startsWith(leafKey + "/") && !currentKey.equals(leafKeySentinel)) { return false; } } return true; } } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled); }
S3Client { boolean isEmpty(String bucket, String key, String leafKey) { List<S3ObjectSummary> objectsLeftAtPath = amazonS3.listObjectsV2(bucket, key + "/").getObjectSummaries(); if (!dryRunEnabled) { return objectsLeftAtPath.size() == 0; } else { String leafKeySentinel = leafKey + S3SentinelFilesCleaner.SENTINEL_SUFFIX; for (S3ObjectSummary s3ObjectSummary : objectsLeftAtPath) { String currentKey = s3ObjectSummary.getKey(); if (!currentKey.startsWith(leafKey + "/") && !currentKey.equals(leafKeySentinel)) { return false; } } return true; } } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled);  }
S3Client { boolean isEmpty(String bucket, String key, String leafKey) { List<S3ObjectSummary> objectsLeftAtPath = amazonS3.listObjectsV2(bucket, key + "/").getObjectSummaries(); if (!dryRunEnabled) { return objectsLeftAtPath.size() == 0; } else { String leafKeySentinel = leafKey + S3SentinelFilesCleaner.SENTINEL_SUFFIX; for (S3ObjectSummary s3ObjectSummary : objectsLeftAtPath) { String currentKey = s3ObjectSummary.getKey(); if (!currentKey.startsWith(leafKey + "/") && !currentKey.equals(leafKeySentinel)) { return false; } } return true; } } S3Client(AmazonS3 amazonS3, boolean dryRunEnabled);   }