org.codehaus.enunciate.modules.rest
Class MultipartFileDataSource
java.lang.Object
org.codehaus.enunciate.modules.rest.RESTRequestDataSource
org.codehaus.enunciate.modules.rest.MultipartFileDataSource
- All Implemented Interfaces:
- javax.activation.DataSource
public class MultipartFileDataSource
- extends RESTRequestDataSource
- Author:
- Ryan Heaton
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultipartFileDataSource
public MultipartFileDataSource(MultipartFile multipartFile)
MultipartFileDataSource
public MultipartFileDataSource(MultipartFile multipartFile,
ContentTypeSupport contentTypeSupport,
javax.servlet.http.HttpServletRequest request)
getInputStream
public InputStream getInputStream()
throws IOException
- Specified by:
getInputStream in interface javax.activation.DataSource- Overrides:
getInputStream in class RESTRequestDataSource
- Throws:
IOException
getContentType
public String getContentType()
- Specified by:
getContentType in interface javax.activation.DataSource- Overrides:
getContentType in class RESTRequestDataSource
getSize
public long getSize()
- Overrides:
getSize in class RESTRequestDataSource
unmarshal
public Object unmarshal()
throws Exception
- Unmarshal this data source based on its content type.
- Returns:
- The unmarshalled data source.
- Throws:
Exception
unmarshalAs
public Object unmarshalAs(String contentType)
throws Exception
- Unmarshal this data source as the specified content type.
- Parameters:
contentType - The content type.
- Returns:
- The unmarshalled object.
- Throws:
Exception
getContentTypeSupport
public ContentTypeSupport getContentTypeSupport()
- The content type support.
- Returns:
- The content type support.
getRequest
public javax.servlet.http.HttpServletRequest getRequest()
- The request from which this file was parsed.
- Returns:
- The request from which this file was parsed.