Class StatusLine


  • public class StatusLine
    extends java.lang.Object
    A very simple representation of a HTTP status line.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String reason  
      private int resultCode  
      private java.lang.String version  
    • Constructor Summary

      Constructors 
      Constructor Description
      StatusLine​(java.lang.String version, int resultCode, java.lang.String reason)
      Create a new StatusLine with the given response code and reason string.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getReason()
      Retrieves the HTTP reason phrase.
      int getResultCode()
      Retrieves the HTTP response code.
      java.lang.String getVersion()
      Retrieves the version string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • version

        private final java.lang.String version
      • resultCode

        private final int resultCode
      • reason

        private final java.lang.String reason
    • Constructor Detail

      • StatusLine

        public StatusLine​(java.lang.String version,
                          int resultCode,
                          java.lang.String reason)
        Create a new StatusLine with the given response code and reason string.
        Parameters:
        version - the version string (normally "HTTP/1.1" or "HTTP/1.0")
        resultCode - the HTTP response code (200, 401, etc.)
        reason - the reason phrase for the code
    • Method Detail

      • getVersion

        public java.lang.String getVersion()
        Retrieves the version string.
        Returns:
        the version string
      • getResultCode

        public int getResultCode()
        Retrieves the HTTP response code.
        Returns:
        the code
      • getReason

        public java.lang.String getReason()
        Retrieves the HTTP reason phrase.
        Returns:
        the reason