org.jboss.resteasy.plugins.providers.multipart
Class MultipartRelatedInputImpl

java.lang.Object
  extended by org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl
      extended by org.jboss.resteasy.plugins.providers.multipart.MultipartRelatedInputImpl
All Implemented Interfaces:
MultipartInput, MultipartRelatedInput

public class MultipartRelatedInputImpl
extends MultipartInputImpl
implements MultipartRelatedInput

Implements MultipartRelatedInput by extending MultipartInputImpl and adding multipart/related functionality.

Version:
$Revision: 1 $
Author:
Attila Kiraly

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl
MultipartInputImpl.PartImpl
 
Field Summary
 
Fields inherited from class org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl
contentType, defaultPartContentType, empty, mimeMessage, parts, workers
 
Constructor Summary
MultipartRelatedInputImpl(MediaType contentType, Providers workers)
           
 
Method Summary
protected  InputPart extractPart(org.apache.james.mime4j.message.BodyPart bodyPart)
           
 java.util.Map<java.lang.String,InputPart> getRelatedMap()
           
 InputPart getRootPart()
           
 java.lang.String getStart()
          A start parameter is not mandatory in a message.
 java.lang.String getStartInfo()
          Optional.
 java.lang.String getType()
          The type parameter as it was read from the content-type header of the multipart/related message.
 void parse(java.io.InputStream is)
           
 
Methods inherited from class org.jboss.resteasy.plugins.providers.multipart.MultipartInputImpl
addHeaderToHeadlessStream, createHeaderInputStream, extractParts, getParts, getPreamble, main
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.resteasy.plugins.providers.multipart.MultipartInput
getParts, getPreamble
 

Constructor Detail

MultipartRelatedInputImpl

public MultipartRelatedInputImpl(MediaType contentType,
                                 Providers workers)
Method Detail

parse

public void parse(java.io.InputStream is)
           throws java.io.IOException
Overrides:
parse in class MultipartInputImpl
Throws:
java.io.IOException

extractPart

protected InputPart extractPart(org.apache.james.mime4j.message.BodyPart bodyPart)
                         throws java.io.IOException
Overrides:
extractPart in class MultipartInputImpl
Throws:
java.io.IOException

getRelatedMap

public java.util.Map<java.lang.String,InputPart> getRelatedMap()
Specified by:
getRelatedMap in interface MultipartRelatedInput
Returns:
a map holding all parts with their unique id-s as keys. The root part and the related parts too.

getRootPart

public InputPart getRootPart()
Specified by:
getRootPart in interface MultipartRelatedInput
Returns:
the root part of the message. If a start parameter was set in the message header the part with that id is returned. If no start parameter was set the first part is returned.

getStart

public java.lang.String getStart()
Description copied from interface: MultipartRelatedInput
A start parameter is not mandatory in a message. If it is presented it holds the id of the root part.

Specified by:
getStart in interface MultipartRelatedInput
Returns:
the start parameter of the content-type header of the message, null if there was no such parameter

getStartInfo

public java.lang.String getStartInfo()
Description copied from interface: MultipartRelatedInput
Optional.

Specified by:
getStartInfo in interface MultipartRelatedInput
Returns:
the start-info parameter of the content-type header of the message, null if there was no such parameter

getType

public java.lang.String getType()
Description copied from interface: MultipartRelatedInput
The type parameter as it was read from the content-type header of the multipart/related message. A well formed multipart/related message always has this parameter. This is the type of the root part of the message. If a content-type header is presented in the root part as well it should hold the same value.

Specified by:
getType in interface MultipartRelatedInput
Returns:
the type parameter of the content-type header of the message, null if there was no such parameter


Copyright © 2009. All Rights Reserved.