Class OpenSshConfigFile.HostEntry

    • Constructor Detail

      • HostEntry

        public HostEntry()
        Constructor used to build the merged entry; never matches anything
      • HostEntry

        public HostEntry​(List<String> patterns)
        Parameters:
        patterns - to be used in matching against host name.
    • Method Detail

      • getValue

        public String getValue​(String key)
        Retrieves the value of a single-valued key, or the first if the key has multiple values. Keys are case-insensitive, so getValue("HostName") == getValue("HOSTNAME").
        Specified by:
        getValue in interface SshConfigStore.HostConfig
        Parameters:
        key - to get the value of
        Returns:
        the value, or null if none
      • getValues

        public List<String> getValues​(String key)
        Retrieves the values of a multi or list-valued key. Keys are case-insensitive, so getValue("HostName") == getValue("HOSTNAME").
        Specified by:
        getValues in interface SshConfigStore.HostConfig
        Parameters:
        key - to get the values of
        Returns:
        a possibly empty list of values
      • setValue

        public void setValue​(String key,
                             String value)
        Sets the value of a single-valued key if it not set yet, or adds a value to a multi-valued key. If the value is null, the key is removed altogether, whether it is single-, list-, or multi-valued.
        Parameters:
        key - to modify
        value - to set or add
      • setValue

        public void setValue​(String key,
                             List<String> values)
        Sets the values of a multi- or list-valued key.
        Parameters:
        key - to set
        values - a non-empty list of values
      • isListKey

        public static boolean isListKey​(String key)
        Does the key take a whitespace-separated list of values?
        Parameters:
        key - to check
        Returns:
        true if the key is a list-valued key.