Package com.luciad

Class Environment.Initializer

java.lang.Object
com.luciad.Environment.Initializer
All Implemented Interfaces:
AutoCloseable
Enclosing class:
Environment

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.

  • Method Details Link icon

    • finalize Link icon

      protected void finalize()
      Overrides:
      finalize in class Object
    • close Link icon

      public void close()
      Specified by:
      close in interface AutoCloseable
    • withLoggingBackend Link icon

      @NotNull public Environment.Initializer withLoggingBackend(@NotNull ILoggingBackend loggingBackend)
      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 Link icon

      @NotNull public Environment.Initializer withLicenseText(@NotNull String licenseText)
      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 Link icon

      @NotNull public Environment.Initializer withResourcePath(@NotNull String resourcePath)
      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 Link icon

      @NotNull public Environment.Initializer shouldInitializeCurl(boolean 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 to true
      Returns:
      this initializer
    • shouldInitializeGdal Link icon

      @NotNull public Environment.Initializer shouldInitializeGdal(boolean 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 to true
      Returns:
      this initializer
    • withCredentialsProvider Link icon

      @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 use
      wrapWithCache - 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.
      Returns:
      this initializer
    • withCredentialsProvider Link icon

      @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 Link icon

      @NotNull public Environment.Initializer withProxySelector(@NotNull IProxySelector proxySelector)
      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 Link icon

      @NotNull public Environment initialize() throws LicenseException
      Create and initialize an Environment.
      Returns:
      the Environment
      Throws:
      LicenseException - when the license text is invalid.