Class Environment.Initializer
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
Environment
Initializer
for the global Environment
needed by this library.
It allows you to configure what and how some things are to be initialized.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
Create and initialize anEnvironment
.shouldInitializeCurl
(boolean shouldInitializeCurl) Specify whether this library should initialize the curl library.shouldInitializeGdal
(boolean shouldInitializeGdal) Specify whether this library should initialize the gdal library.withCredentialsProvider
(ICredentialsProvider credentialsProvider) Specify that the given credential provider should be used.withCredentialsProvider
(ICredentialsProvider credentialsProvider, boolean wrapWithCache) Specify that the given credential provider should be used.withLicenseText
(String licenseText) Specify the content of the LuciadCPillar license file.withLoggingBackend
(ILoggingBackend loggingBackend) Specify that the given logging backend should be used.withProxySelector
(IProxySelector proxySelector) Specify that the given proxy selector should be used.withResourcePath
(String resourcePath) Specify where LuciadCPillar can look for its internal resource.
-
Method Details
-
finalize
protected void finalize() -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
withLoggingBackend
Specify that the given logging backend should be used.If this function is never called by the program, a default implementation is used which writes information to the standard output streams.
- Parameters:
loggingBackend
- the backend to use- Returns:
- this initializer
-
withLicenseText
Specify the content of the LuciadCPillar license file.It is up to the caller to load the license content.
- Parameters:
licenseText
- the content of the license file for LuciadCPillar.- Returns:
- this initializer.
-
withResourcePath
Specify where LuciadCPillar can look for its internal resource.If this method is not invoked, the library with look for its data in the current directory.
- Parameters:
resourcePath
-- Returns:
- this initializer.
-
shouldInitializeCurl
Specify whether this library should initialize the curl library.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.- Parameters:
shouldInitializeCurl
- true to initialize curl,false
not to do so, defaults totrue
- Returns:
- this initializer
-
shouldInitializeGdal
Specify whether this library should initialize the gdal library.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.- Parameters:
shouldInitializeGdal
- true to initialize gdal,false
not to do so, defaults totrue
- Returns:
- this initializer
-
withCredentialsProvider
@NotNull public Environment.Initializer withCredentialsProvider(@NotNull ICredentialsProvider credentialsProvider, boolean wrapWithCache) Specify that the given credential provider should be used.This allows you to connect to network resources requiring authentication.
- Parameters:
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 istrue
.- Returns:
- this initializer
-
withCredentialsProvider
@NotNull public Environment.Initializer withCredentialsProvider(@NotNull ICredentialsProvider credentialsProvider) Specify that the given credential provider should be used.This allows you to connect to network resources requiring authentication.
- Parameters:
credentialsProvider
- the credential provider to use- Returns:
- this initializer
-
withProxySelector
Specify that the given proxy selector should be used.This allows you to connect to network resources which require use of a proxy.
- Parameters:
proxySelector
- the proxy selector to use- Returns:
- this initializer
-
initialize
Create and initialize anEnvironment
.- Returns:
- the
Environment
- Throws:
LicenseException
- when the license text is invalid.
-