public static final class Environment.Initializer extends Object implements AutoCloseable
Initializer
for the global Environment
needed by this library.
It allows you to configure what and how some things are to be initialized.
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
Environment |
initialize()
Create and initialize an
Environment . |
Environment.Initializer |
shouldInitializeCurl(boolean shouldInitializeCurl)
Specify whether this library should initialize the curl library.
|
Environment.Initializer |
shouldInitializeGdal(boolean shouldInitializeGdal)
Specify whether this library should initialize the gdal library.
|
Environment.Initializer |
withCredentialsProvider(ICredentialsProvider credentialsProvider)
Specify that the given credential provider should be used.
|
Environment.Initializer |
withCredentialsProvider(ICredentialsProvider credentialsProvider,
boolean wrapWithCache)
Specify that the given credential provider should be used.
|
Environment.Initializer |
withLicenseText(String licenseText)
Specify the content of the LuciadCPillar license file.
|
Environment.Initializer |
withLoggingBackend(ILoggingBackend loggingBackend)
Specify that the given logging backend should be used.
|
Environment.Initializer |
withProxySelector(IProxySelector proxySelector)
Specify that the given proxy selector should be used.
|
Environment.Initializer |
withResourcePath(String resourcePath)
Specify where LuciadCPillar can look for its internal resource.
|
public void close()
close
in interface AutoCloseable
@NotNull public Environment.Initializer withLoggingBackend(@NotNull ILoggingBackend loggingBackend)
If this function is never called by the program, a default implementation is used which writes information to the standard output streams.
loggingBackend
- the backend to use@NotNull public Environment.Initializer withLicenseText(@NotNull String licenseText)
It is up to the caller to load the license content.
licenseText
- the content of the license file for LuciadCPillar.@NotNull public Environment.Initializer withResourcePath(@NotNull String resourcePath)
If this method is not invoked, the library with look for its data in the current directory.
resourcePath
- @NotNull public Environment.Initializer shouldInitializeCurl(boolean shouldInitializeCurl)
curl is used for network requests done by this library. It contains global initialization and cleanup routines that should be performed only once during the application lifetime. If you set this to false
, but want to use network access-based functionality from this library, you will have to initialize curl yourself.
shouldInitializeCurl
- true to initialize curl, false
not to do so, defaults to true
@NotNull public Environment.Initializer shouldInitializeGdal(boolean shouldInitializeGdal)
gdal is used for reading raster data. It contains global routines that should be performed only once during the application lifetime. If you set this to false
, but want to use this library, you will have to initialize gdal yourself.
shouldInitializeGdal
- true to initialize gdal, false
not to do so, defaults to true
@NotNull public Environment.Initializer withCredentialsProvider(@NotNull ICredentialsProvider credentialsProvider, boolean wrapWithCache)
This allows you to connect to network resources requiring authentication.
credentialsProvider
- the credential provider to usewrapWithCache
- whether you want the credential provider to be wrapped with a caching instance. If not, caching is the responsibility of the credentials provider. The default value is true
.@NotNull public Environment.Initializer withCredentialsProvider(@NotNull ICredentialsProvider credentialsProvider)
This allows you to connect to network resources requiring authentication.
credentialsProvider
- the credential provider to use@NotNull public Environment.Initializer withProxySelector(@NotNull IProxySelector proxySelector)
This allows you to connect to network resources which require use of a proxy.
proxySelector
- the proxy selector to use@NotNull public Environment initialize() throws LicenseException
Environment
.Environment
LicenseException
- when the license text is invalid.