use of com.epam.pipeline.entity.datastorage.DataStorageItemType in project cloud-pipeline by epam.
the class S3Helper method getItems.
public DataStorageListing getItems(String bucket, String path, Boolean showVersion, Integer pageSize, String marker) {
String requestPath = path;
if (requestPath == null) {
requestPath = "";
}
AmazonS3 client = getDefaultS3Client();
if (!StringUtils.isNullOrEmpty(requestPath)) {
DataStorageItemType type = checkItemType(client, bucket, requestPath, showVersion);
if (type == DataStorageItemType.Folder && !requestPath.endsWith(S3Constants.DELIMITER)) {
requestPath += S3Constants.DELIMITER;
}
}
DataStorageListing result = showVersion ? listVersions(client, bucket, requestPath, pageSize, marker) : listFiles(client, bucket, requestPath, pageSize, marker);
result.getResults().sort(AbstractDataStorageItem.getStorageItemComparator());
return result;
}
Aggregations