Package org.eclipse.jgit.transport
Interface SshConfigStore
- All Known Implementing Classes:
OpenSshConfigFile
public interface SshConfigStore
An abstraction for a SSH config storage, like the OpenSSH ~/.ssh/config file.
- Since:
- 5.8
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A host entry from the ssh config. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SshConfigStore.HostConfig
An emptySshConfigStore.HostConfig
. -
Method Summary
Modifier and TypeMethodDescriptionLocate the configuration for a specific host request.lookupDefault
(String hostName, int port, String userName) Locate the configuration for a specific host request and if the configuration has no values forSshConstants.HOST_NAME
,SshConstants.PORT
,SshConstants.USER
, orSshConstants.CONNECTION_ATTEMPTS
, fill those values with defaults from the arguments: ssh config key value from argumentHostName
hostName
Port
port > 0 ? port : 22
User
userName
ConnectionAttempts
1
-
Field Details
-
EMPTY_CONFIG
An emptySshConfigStore.HostConfig
.
-
-
Method Details
-
lookup
Locate the configuration for a specific host request.- Parameters:
hostName
- to look upport
- the user supplied; <= 0 if noneuserName
- the user supplied, may benull
or empty if none given- Returns:
- the configuration for the requested name.
-
lookupDefault
@NonNull SshConfigStore.HostConfig lookupDefault(@NonNull String hostName, int port, String userName) Locate the configuration for a specific host request and if the configuration has no values forSshConstants.HOST_NAME
,SshConstants.PORT
,SshConstants.USER
, orSshConstants.CONNECTION_ATTEMPTS
, fill those values with defaults from the arguments:ssh config key value from argument HostName
hostName
Port
port > 0 ? port : 22
User
userName
ConnectionAttempts
1
- Parameters:
hostName
- host name to look upport
- port number; <= 0 if noneuserName
- the user name, may benull
or empty if none given- Returns:
- the configuration for the requested name.
- Since:
- 6.0
-