@@ -45,8 +45,8 @@ public class RemoteGcsHelper {
45
45
46
46
private static final Logger log = Logger .getLogger (RemoteGcsHelper .class .getName ());
47
47
private static final String BUCKET_NAME_PREFIX = "gcloud-test-bucket-temp-" ;
48
- private static final String PROJECT_ID_ENV_VAR = "GCLOUD_TESTS_PROJECT_ID " ;
49
- private static final String PRIVATE_KEY_ENV_VAR = "GCLOUD_TESTS_KEY " ;
48
+ private static final String PROJECT_ID_ENV_VAR = "GCLOUD_PROJECT " ;
49
+ private static final String PRIVATE_KEY_ENV_VAR = "GOOGLE_APPLICATION_CREDENTIALS " ;
50
50
private final StorageOptions options ;
51
51
52
52
private RemoteGcsHelper (StorageOptions options ) {
@@ -145,22 +145,17 @@ public static RemoteGcsHelper create(String projectId, String keyPath)
145
145
log .log (Level .WARNING , ex .getMessage ());
146
146
}
147
147
throw GcsHelperException .translate (ex );
148
- } catch (IOException ex ) {
149
- if (log .isLoggable (Level .WARNING )) {
150
- log .log (Level .WARNING , ex .getMessage ());
151
- }
152
- throw GcsHelperException .translate (ex );
153
148
}
154
149
}
155
150
156
151
/**
157
152
* Creates a {@code RemoteGcsHelper} object. Project id and path to JSON key are read from two
158
- * environment variables: {@code GCLOUD_TESTS_PROJECT_ID } and {@code GCLOUD_TESTS_KEY }.
153
+ * environment variables: {@code GCLOUD_PROJECT } and {@code GOOGLE_APPLICATION_CREDENTIALS }.
159
154
*
160
155
* @return A {@code RemoteGcsHelper} object for the provided options.
161
156
* @throws com.google.gcloud.storage.testing.RemoteGcsHelper.GcsHelperException if environment
162
- * variables {@code GCLOUD_TESTS_PROJECT_ID } and {@code GCLOUD_TESTS_KEY } are not set or if
163
- * the file pointed by {@code GCLOUD_TESTS_KEY } does not exist
157
+ * variables {@code GCLOUD_PROJECT } and {@code GOOGLE_APPLICATION_CREDENTIALS } are not set or
158
+ * if the file pointed by {@code GOOGLE_APPLICATION_CREDENTIALS } does not exist
164
159
*/
165
160
public static RemoteGcsHelper create () throws GcsHelperException {
166
161
String projectId = System .getenv (PROJECT_ID_ENV_VAR );
0 commit comments