Class URLReturnData


  • public class URLReturnData
    extends java.lang.Object
    This class encapsulates data returned from a URL including a byte[] array containing the contents and a map representing the header data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] getData()
      Return the response contents.
      java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaderFields()
      Returns an unmodifiable Map of the header fields.
      void setData​(byte[] bytes)
      Set the response contents.
      void setHeaderFields​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headerFields)
      Set the header fields map.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • URLReturnData

        public URLReturnData()
      • URLReturnData

        public URLReturnData​(byte[] pData)
        Parameters:
        pData - response contents as a byte[]
    • Method Detail

      • setData

        public void setData​(byte[] bytes)
        Set the response contents.
        Parameters:
        bytes - response contents
      • setHeaderFields

        public void setHeaderFields​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> headerFields)
        Set the header fields map.
        Parameters:
        headerFields - list of header fields
      • getData

        public byte[] getData()
        Return the response contents.
        Returns:
        response contents
      • getHeaderFields

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getHeaderFields()
        Returns an unmodifiable Map of the header fields. The Map keys are Strings that represent the response-header field names. Each Map value is an unmodifiable List of Strings that represents the corresponding field values.
        Returns:
        map of response header fields to a list of their field values
        See Also:
        URLConnection.getHeaderFields()