use of com.epam.pipeline.entity.datastorage.DataStorageDownloadFileUrl in project cloud-pipeline by epam.
the class DataStorageManager method generateDataStorageItemUploadUrl.
public List<DataStorageDownloadFileUrl> generateDataStorageItemUploadUrl(Long id, List<String> paths) {
AbstractDataStorage dataStorage = load(id);
List<DataStorageDownloadFileUrl> urls = new ArrayList<>();
if (paths == null) {
return urls;
}
paths.forEach(path -> urls.add(storageProviderManager.generateDataStorageItemUploadUrl(dataStorage, path)));
return urls;
}
use of com.epam.pipeline.entity.datastorage.DataStorageDownloadFileUrl in project cloud-pipeline by epam.
the class DataStorageManager method generateDataStorageItemUrl.
public List<DataStorageDownloadFileUrl> generateDataStorageItemUrl(final Long dataStorageId, final List<String> paths) {
AbstractDataStorage dataStorage = load(dataStorageId);
List<DataStorageDownloadFileUrl> urls = new ArrayList<>();
if (paths == null) {
return urls;
}
paths.forEach(path -> urls.add(storageProviderManager.generateDownloadURL(dataStorage, path, null)));
return urls;
}
use of com.epam.pipeline.entity.datastorage.DataStorageDownloadFileUrl in project cloud-pipeline by epam.
the class NFSStorageProvider method generateDownloadURL.
@Override
public DataStorageDownloadFileUrl generateDownloadURL(NFSDataStorage dataStorage, String path, String version) {
String baseApiHostExternal = preferenceManager.getPreference(SystemPreferences.BASE_API_HOST_EXTERNAL);
String baseApiHost = StringUtils.isNotBlank(baseApiHostExternal) ? baseApiHostExternal : preferenceManager.getPreference(SystemPreferences.BASE_API_HOST);
if (StringUtils.isBlank(baseApiHost)) {
throw new IllegalArgumentException(String.format("Cannot generate URL: preference %s or %s is not set", SystemPreferences.BASE_API_HOST.getKey(), SystemPreferences.BASE_API_HOST_EXTERNAL.getKey()));
}
DataStorageDownloadFileUrl url = new DataStorageDownloadFileUrl();
url.setUrl(baseApiHost + "datastorage/" + dataStorage.getId() + "/download?path=" + path);
return url;
}
use of com.epam.pipeline.entity.datastorage.DataStorageDownloadFileUrl in project cloud-pipeline by epam.
the class S3Helper method generatePresignedUrl.
private DataStorageDownloadFileUrl generatePresignedUrl(AmazonS3 client, Date expires, String tagValue, GeneratePresignedUrlRequest request) {
URL url = client.generatePresignedUrl(request);
DataStorageDownloadFileUrl dataStorageDownloadFileUrl = new DataStorageDownloadFileUrl();
dataStorageDownloadFileUrl.setUrl(url.toExternalForm());
dataStorageDownloadFileUrl.setExpires(expires);
dataStorageDownloadFileUrl.setTagValue(tagValue);
return dataStorageDownloadFileUrl;
}
Aggregations