com.basho.riak.client.util
Class Multipart

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

public class Multipart
extends java.lang.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 java.lang.String getBoundary(java.lang.String contentType)
          Given a content type value, get the "boundary" parameter
static java.util.List<Multipart.Part> parse(java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String body)
          Parses a multipart message or a multipart subpart of a multipart message.
static java.util.Map<java.lang.String,java.lang.String> parseHeaders(java.lang.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 java.util.List<Multipart.Part> parse(java.util.Map<java.lang.String,java.lang.String> headers,
                                                   java.lang.String 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 java.util.Map<java.lang.String,java.lang.String> parseHeaders(java.lang.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 java.lang.String getBoundary(java.lang.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 © 2010. All Rights Reserved.