Class ScpLocation

    • Method Detail

      • getHost

        public String getHost()
      • setHost

        public void setHost​(String host)
      • isLocal

        public boolean isLocal()
      • getUsername

        public String getUsername()
        Specified by:
        getUsername in interface UsernameHolder
        Returns:
        The attached username - may be null/empty if holder not yet initialized
      • resolveUsername

        public String resolveUsername()
        Resolves the effective username to use for a remote location. If username not set then uses the current username
        Returns:
        The resolved username
        See Also:
        getUsername(), OsUtils.getCurrentUser()
      • getPath

        public String getPath()
      • setPath

        public void setPath​(String path)
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • update

        public static <L extends ScpLocation> L update​(String locSpec,
                                                       L location)
        Parses a local or remote SCP location in the format user@host:path
        Type Parameters:
        L - Type of ScpLocation being updated
        Parameters:
        locSpec - The location specification - ignored if null/empty
        location - The ScpLocation to update - never null
        Returns:
        The updated location (unless no specification)
        Throws:
        IllegalArgumentException - if invalid specification