Package com.backblaze.b2.client
Interface B2StorageClientFactory
-
- All Known Implementing Classes:
B2StorageClientFactoryPathBasedImpl
public interface B2StorageClientFactory
Implementations of B2StorageClientFactory can create a B2StorageClient from a B2ClientConfig. There are a couple of convenience methods for constructing B2ClientConfigs. THREAD-SAFE.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description B2StorageClient
create(B2ClientConfig config)
default B2StorageClient
create(java.lang.String userAgent)
Gets the applicationKeyId and applicationKey from the environment and thendefault B2StorageClient
create(java.lang.String applicationKeyId, java.lang.String applicationKey, java.lang.String userAgent)
static B2StorageClientFactory
createDefaultFactory()
-
-
-
Method Detail
-
createDefaultFactory
static B2StorageClientFactory createDefaultFactory()
- Returns:
- a new B2StorageClientFactory that picks whichever of the built-in B2StorageClientFactorys is on the java class path.
-
create
B2StorageClient create(B2ClientConfig config)
- Parameters:
config
- the configuration to use.- Returns:
- a new B2StorageClient or throws a RuntimeException if it can't make one.
-
create
default B2StorageClient create(java.lang.String applicationKeyId, java.lang.String applicationKey, java.lang.String userAgent)
- Parameters:
applicationKeyId
- the id of the secret to use to authenticate with the b2 serversapplicationKey
- the secret used to authenticate with the b2 servers.userAgent
- the user agent to use when performing http requests.- Returns:
- a new B2StorageClient or throws a RuntimeException if it can't make one.
-
create
default B2StorageClient create(java.lang.String userAgent)
Gets the applicationKeyId and applicationKey from the environment and then- Parameters:
userAgent
- the user agent to use when performing http requests.- Returns:
- a new B2StorageClient or throws a RuntimeException if it can't make one.
- Throws:
java.lang.RuntimeException
- if there's a problem getting the credentials from the environment or any other problem creating the client.
-
-