How to use generatePreSignedURLIfExists method of com.testsigma.service.AzureBlobStorageService class

Best Testsigma code snippet using com.testsigma.service.AzureBlobStorageService.generatePreSignedURLIfExists

Source:AzureBlobStorageService.java Github

copy

Full Screen

...99 }100 return url;101 }102 @Override103 public Optional<URL> generatePreSignedURLIfExists(String relativeFilePathFromBase, StorageAccessLevel storageAccessLevel, Integer expiryTimeInMinutes) {104 relativeFilePathFromBase = removeLeadingSeparatorCharacterIfPresent(relativeFilePathFromBase);105 log.debug("Generating Shared service access URL if exists: " + relativeFilePathFromBase);106 Optional<URL> returnURL = Optional.empty();107 try {108 CloudBlockBlob blob = container.getBlockBlobReference(relativeFilePathFromBase);109 if (blob.exists()) {110 log.debug("File exists, generating presigned URL for: " + relativeFilePathFromBase);111 returnURL = Optional.ofNullable(generatePreSignedURL(relativeFilePathFromBase, storageAccessLevel, expiryTimeInMinutes));112 }113 } catch (Exception e) {114 log.error("Unable to generate Shared Access URL,Please verify given account details in " +115 "azure-blob.properties. " + e.getMessage(), e);116 }117 return returnURL;118 }119 @Override120 public Optional<URL> generatePreSignedURLIfExists(String relativeFilePathFromBase, StorageAccessLevel storageAccessLevel) {121 relativeFilePathFromBase = removeLeadingSeparatorCharacterIfPresent(relativeFilePathFromBase);122 return generatePreSignedURLIfExists(relativeFilePathFromBase, storageAccessLevel,123 storageConfig.getAzureBlobPreSignedURLTimeout());124 }125 @Override126 public URL generatePreSignedURL(String relativeFilePathFromBase, StorageAccessLevel storageAccessLevel) {127 relativeFilePathFromBase = removeLeadingSeparatorCharacterIfPresent(relativeFilePathFromBase);128 return generatePreSignedURL(relativeFilePathFromBase, storageAccessLevel,129 storageConfig.getAzureBlobPreSignedURLTimeout());130 }131 @Override132 public void deleteFile(String filePath) {133 filePath = removeLeadingSeparatorCharacterIfPresent(filePath);134 log.debug("Deleting file: " + filePath);135 try {136 CloudBlockBlob blob = container.getBlockBlobReference(filePath);...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Testsigma automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful