com.basho.riak.client.http.util
Class Multipart

java.lang.Object
  extended by com.basho.riak.client.http.util.Multipart

public class Multipart
extends Object

Represents a multipart entity as described here: http://tools.ietf.org/html/rfc2046#section-5.1


Nested Class Summary
static class Multipart.Part
          A single part of a multipart entity
 
Constructor Summary
Multipart()
           
 
Method Summary
static String getBoundary(String contentType)
          Given a content type value, get the "boundary" parameter
static List<Multipart.Part> parse(Map<String,String> headers, byte[] body)
          Parses a multipart message or a multipart subpart of a multipart message.
static Map<String,String> parseHeaders(String s)
          Parse a block of header lines as defined here: http://tools.ietf.org/html/rfc822#section-3.2
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Multipart

public Multipart()
Method Detail

parse

public static List<Multipart.Part> parse(Map<String,String> headers,
                                         byte[] body)
Parses a multipart message or a multipart subpart of a multipart message.

Returns:
A list of the parts parsed into headers and body of this multipart message

parseHeaders

public static Map<String,String> parseHeaders(String s)
Parse a block of header lines as defined here: http://tools.ietf.org/html/rfc822#section-3.2

Parameters:
s - The header blob
Returns:
Map of header names to values

getBoundary

public static String getBoundary(String contentType)
Given a content type value, get the "boundary" parameter

Parameters:
contentType - Content type value with boundary parameter. Should be of the form "type/subtype; boundary=foobar; param=value"
Returns:
Value of the boundary parameter


Copyright © 2012. All Rights Reserved.