public class ConcourseClientPreferences extends PreferencesHandler
concourse_client.prefs file that is used to
configure a client connection.
Instantiate using open(String)
| Modifier and Type | Field and Description |
|---|---|
protected static char[] |
NO_PASSWORD_DEFINED
An empty char array to return if there is no password defined in the
prefs file during a call to
getPasswordExplicit(). |
| Modifier and Type | Method and Description |
|---|---|
static ConcourseClientPreferences |
from(Path... files)
Return a
ConcourseClientPreferences handler that is sourced from
the files. |
static ConcourseClientPreferences |
fromCurrentWorkingDirectory()
Return a
ConcourseClientPreferences handler that is sourced from
a concourse_client.prefs file in the current working directory. |
static ConcourseClientPreferences |
fromUserHomeDirectory()
Return a
ConcourseClientPreferences handler that is sourced from
a concourse_client.prefs file in the user's home directory. |
String |
getEnvironment()
Return the value associated with the
environment key. |
String |
getHost()
Return the value associated with the
host key. |
char[] |
getPassword()
Return the value associated with the
password key. |
char[] |
getPasswordExplicit()
Return the value associated with the
password key, if it is
explicitly defined in the prefs file. |
int |
getPort()
Return the value associated with the
port key. |
String |
getUsername()
Return the value associated with the
username key. |
static ConcourseClientPreferences |
open(String file)
Deprecated.
use
ConcourseServerPreferences.from(Path...) instead |
void |
setEnvironment(String environment)
Set the value associated with the
environment key. |
void |
setHost(String host)
Set the value associated with the
host key. |
void |
setPassword(char[] password)
Set the value associated with the
password key. |
void |
setPort(int port)
Set the value associated with the
port key. |
void |
setUsername(String username)
Set the value associated with the
username key. |
getEnum, getSizeprotected static final char[] NO_PASSWORD_DEFINED
getPasswordExplicit().public static ConcourseClientPreferences from(Path... files)
ConcourseClientPreferences handler that is sourced from
the files.files - public static ConcourseClientPreferences fromCurrentWorkingDirectory()
ConcourseClientPreferences handler that is sourced from
a concourse_client.prefs file in the current working directory.public static ConcourseClientPreferences fromUserHomeDirectory()
ConcourseClientPreferences handler that is sourced from
a concourse_client.prefs file in the user's home directory.@Deprecated public static ConcourseClientPreferences open(String file)
ConcourseServerPreferences.from(Path...) insteadConcourseClientPreferences wrapper that is backed by the
configuration information in file.file - the absolute path to the preferences file (relative paths
will resolve to the user's home directory)public String getEnvironment()
environment key.public String getHost()
host key.public char[] getPassword()
password key.
NOTE: This method returns the password as a char array so that the caller can null out the data immediately after use. This is generally advised to limit the amount of time that the sensitive data remains in memory.
public char[] getPasswordExplicit()
password key, if it is
explicitly defined in the prefs file. Unlike the getPassword()
method, this one will not return the default password if one is not
explicitly defined in the file.
NOTE: This method returns the password as a char array so that the caller can null out the data immediately after use. This is generally advised to limit the amount of time that the sensitive data remains in memory.
public int getPort()
port key.public String getUsername()
username key.public void setEnvironment(String environment)
environment key.environment - public void setHost(String host)
host key.host - public void setPassword(char[] password)
password key.password - public void setPort(int port)
port key.port - public void setUsername(String username)
username key.username -