Package com.snowbound.common.utils
Class URLReturnData
- java.lang.Object
-
- com.snowbound.common.utils.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.
-
-
Constructor Summary
Constructors Constructor Description URLReturnData()
URLReturnData(byte[] pData)
-
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.
-
-
-
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()
-
-