Hello Guys
I'm having some problem on initializing credentials
the example code is:
(ns upload.gcs
(:import com.google.auth.oauth2.ServiceAccountCredentials))
(def service (atom nil))
(defn credentials-from-stream [credentials-filename]
(-> credentials-filename
io/resource
io/input-stream
ServiceAccountCredentials/fromStream))
(defn initialize [project-id credentials-filename]
(let [creds (credentials-from-stream credentials-filename)
new-service (-> (StorageOptions/newBuilder)
(.setProjectId project-id)
(.setCredentials creds)
(.build)
(.getService))]
(reset! service new-service)
true))
I'm using some .json credentials to credentials filename
the error came from this part of the code:
new-service (-> (StorageOptions/newBuilder)
(.setProjectId project-id)
(.setCredentials creds)
(.build)
(.getService))
when I do
.getService
it returns:
Execution error (NoSuchMethodError) at com.google.api.services.storage.Storage$Builder/setBatchPath (Storage.java:9353).
com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.setBatchPath(Ljava/lang/String;)Lcom/google/api/client/googleapis/services/AbstractGoogleClient$Builder;
when I use (.setCredentials creds)
gives me this same error:
Execution error (NoSuchMethodError) at com.google.api.services.storage.Storage$Builder/setBatchPath (Storage.java:9353).
com.google.api.client.googleapis.services.json.AbstractGoogleJsonClient$Builder.setBatchPath(Ljava/lang/String;)Lcom/google/api/client/googleapis/services/AbstractGoogleClient$Builder;
=<
but thanks for the snippet
anyone knows about this error?