Example usage for com.amazonaws ClientConfiguration getUserAgent

List of usage examples for com.amazonaws ClientConfiguration getUserAgent

Introduction

In this page you can find the example usage for com.amazonaws ClientConfiguration getUserAgent.

Prototype

@Deprecated
public String getUserAgent() 

Source Link

Usage

From source file:com.amazon.kinesis.streaming.agent.AgentContext.java

License:Open Source License

/**
 * @param config//from  w w  w.  j  a  va 2  s  . c om
 * @return the user agent component for this build.
 */
public String userAgent(ClientConfiguration config) {
    if (containsKey("userAgentOverride")) {
        return readString("userAgentOverride");
    } else {
        String userAgentString = DEFAULT_USER_AGENT + "/" + version();
        if (config != null) {
            userAgentString += " " + config.getUserAgent();
        }
        String customAgent = readString("userAgent", null);
        if (customAgent != null && !customAgent.trim().isEmpty()) {
            userAgentString = customAgent.trim() + " " + userAgentString;
        }
        return userAgentString;
    }
}