Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCP Changes #41

Open
wants to merge 2 commits into
base: scala-2.12-with-latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]{
Expand Down