• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

JohnSnowLabs / spark-nlp / 7961349851

19 Feb 2024 02:47PM CUT coverage: 62.707%. First build
7961349851

Pull #14164

github

web-flow
Merge 3cff1f821 into 033847426
Pull Request #14164: release/530-release-candidate

8964 of 14295 relevant lines covered (62.71%)

0.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/scala/com/johnsnowlabs/client/gcp/GCPClient.scala
1
/*
2
 * Copyright 2017-2022 John Snow Labs
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *    http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16
package com.johnsnowlabs.client.gcp
17

18
import com.johnsnowlabs.client.{CloudClient, CloudStorage}
19
import com.johnsnowlabs.util.{ConfigHelper, ConfigLoader}
20

21
class GCPClient(parameters: Map[String, String] = Map.empty) extends CloudClient {
22

23
  private lazy val gcpStorageConnection = cloudConnect()
24

25
  override protected def cloudConnect(): CloudStorage = {
26
    val projectId = parameters.getOrElse(
×
27
      "projectId",
×
28
      ConfigLoader.getConfigStringValue(ConfigHelper.gcpProjectId))
×
29
    new GCPGateway(projectId)
×
30
  }
31

32
  override def doesBucketPathExist(bucketName: String, filePath: String): Boolean = {
33
    gcpStorageConnection.doesBucketPathExist(bucketName, filePath)
×
34
  }
35

36
  override def copyInputStreamToBucket(
37
      bucketName: String,
38
      filePath: String,
39
      sourceFilePath: String): Unit = {
40
    gcpStorageConnection.copyInputStreamToBucket(bucketName, filePath, sourceFilePath)
×
41
  }
42

43
  override def downloadFilesFromBucketToDirectory(
44
      bucketName: String,
45
      filePath: String,
46
      directoryPath: String,
47
      isIndex: Boolean): Unit = {
48
    gcpStorageConnection.downloadFilesFromBucketToDirectory(
×
49
      bucketName,
50
      filePath,
51
      directoryPath,
52
      isIndex)
53
  }
54

55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc