/** * Compares this HTTP protocol version with another one. * * @param anotherVer the version to be compared with. * * @return a negative integer, zero, or a positive integer as this version is less than, * equal to, or greater than the specified version. */ public int compareTo(HttpVersion anotherVer) { if (anotherVer == null) { throw new IllegalArgumentException("Version parameter may not be null"); } int delta = getMajor() - anotherVer.getMajor(); if (delta == 0) { delta = getMinor() - anotherVer.getMinor(); } return delta; }
@Override public HttpVersion getProtocol() { org.apache.commons.httpclient.HttpVersion version = httpMethod .getParams().getVersion(); if (version == null) { return null; } Header connection = httpMethod.getResponseHeader("Connection"); if (protocol == null) { protocol = new HttpVersion("HTTP", version.getMajor(), version.getMinor(), connection != null && KEEP_ALIVE.equalsIgnoreCase(connection .getValue())); } return protocol; }
/** * Compares this HTTP protocol version with another one. * * @param anotherVer the version to be compared with. * * @return a negative integer, zero, or a positive integer as this version is less than, * equal to, or greater than the specified version. */ public int compareTo(HttpVersion anotherVer) { if (anotherVer == null) { throw new IllegalArgumentException("Version parameter may not be null"); } int delta = getMajor() - anotherVer.getMajor(); if (delta == 0) { delta = getMinor() - anotherVer.getMinor(); } return delta; }
/** * Compares this HTTP protocol version with another one. * * @param anotherVer the version to be compared with. * * @return a negative integer, zero, or a positive integer as this version is less than, * equal to, or greater than the specified version. */ public int compareTo(HttpVersion anotherVer) { if (anotherVer == null) { throw new IllegalArgumentException("Version parameter may not be null"); } int delta = getMajor() - anotherVer.getMajor(); if (delta == 0) { delta = getMinor() - anotherVer.getMinor(); } return delta; }
/** * Compares this HTTP protocol version with another one. * * @param anotherVer the version to be compared with. * * @return a negative integer, zero, or a positive integer as this version is less than, * equal to, or greater than the specified version. */ public int compareTo(HttpVersion anotherVer) { if (anotherVer == null) { throw new IllegalArgumentException("Version parameter may not be null"); } int delta = getMajor() - anotherVer.getMajor(); if (delta == 0) { delta = getMinor() - anotherVer.getMinor(); } return delta; }
/** * Compares this HTTP protocol version with another one. * * @param anotherVer the version to be compared with. * * @return a negative integer, zero, or a positive integer as this version is less than, * equal to, or greater than the specified version. */ public int compareTo(HttpVersion anotherVer) { if (anotherVer == null) { throw new IllegalArgumentException("Version parameter may not be null"); } int delta = getMajor() - anotherVer.getMajor(); if (delta == 0) { delta = getMinor() - anotherVer.getMinor(); } return delta; }
@Override public HttpVersion getProtocol() { org.apache.commons.httpclient.HttpVersion version = httpMethod .getParams().getVersion(); if (version == null) { return null; } Header connection = httpMethod.getResponseHeader("Connection"); if (protocol == null) { protocol = new HttpVersion("HTTP", version.getMajor(), version.getMinor(), connection != null && KEEP_ALIVE.equalsIgnoreCase(connection .getValue())); } return protocol; }