Class ConnectionParameters


public class ConnectionParameters extends Object
Connection parameters, such as username/password, that may be needed to connect to a server.
Last modified
$Date: 2018-04-09 15:23:53 +0200 (må, 09 apr 2018) $
  • Field Details

    • factoryId

      private String factoryId
    • host

      private String host
    • username

      private String username
    • password

      private String password
    • rootPath

      private String rootPath
    • sshFingerprint

      private String sshFingerprint
    • sshPrivateKey

      private byte[] sshPrivateKey
    • sshPrivateKeyPassword

      private String sshPrivateKeyPassword
    • sshPrivateKeyFormat

      private String sshPrivateKeyFormat
    • serverCertificate

      private byte[] serverCertificate
    • clientCertificate

      private byte[] clientCertificate
    • clientCertificatePassword

      private String clientCertificatePassword
  • Constructor Details

    • ConnectionParameters

      public ConnectionParameters()
      Create a new empty parameters object.
  • Method Details

    • create

      public static ConnectionParameters create(FileServerData fileServer)
      Create a parameters object using information from the FileServer object.
    • getConnectionManagerFactoryId

      public String getConnectionManagerFactoryId()
      Get the connection manager factory that we should use to access the file, or null to use auto-detection.
    • setConnectionManagerFactoryId

      public void setConnectionManagerFactoryId(String factoryId)
    • getHost

      public String getHost()
      Get the host:port that should override the host:port specified by the file URI.
    • setHost

      public void setHost(String host)
    • getUsername

      public String getUsername()
      Get the username that should be used to authenticate the user.
    • setUsername

      public void setUsername(String username)
    • getPassword

      public String getPassword()
      Get the password that should be used to authenticate the user.
    • setPassword

      public void setPassword(String password)
    • getRootPath

      public String getRootPath()
      Get the root path that must be added to all URI:s used with these connection parameters.
    • setRootPath

      public void setRootPath(String rootPath)
    • getServerCertificate

      public byte[] getServerCertificate()
      Get the public server certificate that indicates that we should only trust the server if it can present a certificate that matches this. This property is typically only needed when using SSL to access servers that has a self-signed certificate. Servers which has a certificate signed by a trusted certification authority should be automatically trusted by BASE without this property. The certificate is a X.509 certificate in either binary or base64-encoded DER format.
      A byte array with the certificate or null if no certificate has been set
      See Also:
    • setServerCertificate

      public void setServerCertificate(byte[] certificate)
    • getClientCertificate

      public byte[] getClientCertificate()
      Get the client certificate that BASE should use to authenticate with the server when connecting using SSL. This property is typically needed when the server requires clients to authenticate themselves using a certificate. The certificate must be a PKCS #12 certificate in binary format, and it should contain only one certificate.
      A byte array with the certificate or null if no certificate has been set
      See Also:
    • setClientCertificate

      public void setClientCertificate(byte[] certificate)
    • getClientCertificatePassword

      public String getClientCertificatePassword()
      Get the password that is needed to unlock the client certificate.
      The password (which may be null)
    • setClientCertificatePassword

      public void setClientCertificatePassword(String password)
    • getSshFingerprint

      public String getSshFingerprint()
      Get the SSH fingerprint of the server. Should be used to verify the connection when connecting via SSH.
    • setSshFingerprint

      public void setSshFingerprint(String sshFingerprint)
    • getSshPrivateKey

      public byte[] getSshPrivateKey()
      Get the private key that should be used to authenticate with the server when connecting using SSH.
    • setSshPrivateKey

      public void setSshPrivateKey(byte[] sshPrivateKey)
    • getSshPrivateKeyPassword

      public String getSshPrivateKeyPassword()
      Get the password that is needed to unlock the SSH private key.
      The password (which may be null)
    • setSshPrivateKeyPassword

      public void setSshPrivateKeyPassword(String password)
    • getSshPrivateKeyFormat

      public String getSshPrivateKeyFormat()
      Get the format of the SSH private key (if known).
      The private key format (or null to try auto-detection)
    • setSshPrivateKeyFormat

      public void setSshPrivateKeyFormat(String format)
    • changeHost

      public URI changeHost(URI uri)
      If the connection parameters include a specific host:port or root path a new URI is created were the host:port is replaced and the root path is added to the URI path. Otherwise the original URI is returned unmodified.
      uri - The URI to change
      The new URI
      PermissionDeniedException - If the given URI tries to move outside the root path by including '..' to step up one or more levels