|
39 | 39 | import java.util.logging.Logger; |
40 | 40 |
|
41 | 41 | /** |
42 | | - * Utility to create a remote storage configuration for testing |
| 42 | + * Utility to create a remote storage configuration for testing. Storage options can be obtained via |
| 43 | + * the {@link #options()} method. Returned options have custom {@link StorageOptions#retryParams()}: |
| 44 | + * {@link RetryParams#retryMaxAttempts()} is {@code 10}, {@link RetryParams#retryMinAttempts()} is |
| 45 | + * {@code 6}, {@link RetryParams#maxRetryDelayMillis()} is {@code 30000}, |
| 46 | + * {@link RetryParams#totalRetryPeriodMillis()} is {@code 120000} and |
| 47 | + * {@link RetryParams#initialRetryDelayMillis()} is {@code 250}. |
| 48 | + * {@link StorageOptions#connectTimeout()} and {@link StorageOptions#readTimeout()} are both set |
| 49 | + * to {@code 60000}. |
43 | 50 | */ |
44 | 51 | public class RemoteGcsHelper { |
45 | 52 |
|
@@ -118,28 +125,6 @@ public static RemoteGcsHelper create(String projectId, InputStream keyStream) |
118 | 125 | } |
119 | 126 | } |
120 | 127 |
|
121 | | - /** |
122 | | - * Creates a {@code RemoteGcsHelper} object for the given project id and JSON key path. |
123 | | - * |
124 | | - * @param projectId id of the project to be used for running the tests |
125 | | - * @param keyPath path to the JSON key to be used for running the tests |
126 | | - * @return A {@code RemoteGcsHelper} object for the provided options. |
127 | | - * @throws com.google.gcloud.storage.testing.RemoteGcsHelper.GcsHelperException if the file |
128 | | - * pointed by {@code keyPath} does not exist |
129 | | - */ |
130 | | - public static RemoteGcsHelper create(String projectId, String keyPath) |
131 | | - throws GcsHelperException { |
132 | | - try { |
133 | | - InputStream keyFileStream = new FileInputStream(keyPath); |
134 | | - return create(projectId, keyFileStream); |
135 | | - } catch (FileNotFoundException ex) { |
136 | | - if (log.isLoggable(Level.WARNING)) { |
137 | | - log.log(Level.WARNING, ex.getMessage()); |
138 | | - } |
139 | | - throw GcsHelperException.translate(ex); |
140 | | - } |
141 | | - } |
142 | | - |
143 | 128 | /** |
144 | 129 | * Creates a {@code RemoteGcsHelper} object using default project id and authentication |
145 | 130 | * credentials. |
|
0 commit comments