diff --git a/src/main/scala/org/sunbird/cloud/storage/BaseStorageService.scala b/src/main/scala/org/sunbird/cloud/storage/BaseStorageService.scala index f2325f3..34162ce 100644 --- a/src/main/scala/org/sunbird/cloud/storage/BaseStorageService.scala +++ b/src/main/scala/org/sunbird/cloud/storage/BaseStorageService.scala @@ -122,7 +122,8 @@ trait BaseStorageService extends IStorageService { override def getSignedURL(container: String, objectKey: String, ttl: Option[Int] = None, permission: Option[String] = Option("r")): String = { if (context.getBlobStore.toString.contains("google")) { - throw new StorageServiceException("getSignedURL method is not supported for GCP. Please use getPutSignedURL with contentType.", new Exception()) + getPutSignedURL(container, objectKey, ttl, permission, Option("text/plain")) + //throw new StorageServiceException("getSignedURL method is not supported for GCP. Please use getPutSignedURL with contentType.", new Exception()) } else { if (permission.getOrElse("").equalsIgnoreCase("w")) { diff --git a/src/test/scala/org/sunbird/cloud/storage/service/TestGcloudStorageService.scala b/src/test/scala/org/sunbird/cloud/storage/service/TestGcloudStorageService.scala index 7395ce0..8602141 100644 --- a/src/test/scala/org/sunbird/cloud/storage/service/TestGcloudStorageService.scala +++ b/src/test/scala/org/sunbird/cloud/storage/service/TestGcloudStorageService.scala @@ -52,11 +52,13 @@ class TestGcloudStorageService extends FlatSpec with Matchers { // gsService.deleteObject(storageContainer, "testDuplicate/", Option(true)) // gsService.deleteObject(storageContainer, "testUpload/test-extract/", Option(true)) - val caught1 = - intercept[StorageServiceException]{ - gsService.getSignedURL(storageContainer, "testUpload/test-data-public1.log", Option(600), Option("w")) - } - assert(caught1.getMessage.contains("getSignedURL method is not supported for GCP. Please use getPutSignedURL with contentType.")) +// val caught1 = { +// intercept[StorageServiceException]{ +// gsService.getSignedURL(storageContainer, "testUpload/test-data-public1.log", Option(600), Option("w")) +// } +// +// } +// assert(caught1.getMessage.contains("getSignedURL method is not supported for GCP. Please use getPutSignedURL with contentType.")) val caught2 = intercept[StorageServiceException]{