Class Attachment
- java.lang.Object
-
- org.apache.cxf.jaxrs.ext.multipart.Attachment
-
- All Implemented Interfaces:
org.apache.cxf.io.Transferable
public class Attachment extends Object implements org.apache.cxf.io.Transferable
This class represents an attachment; generally a multipart part. Some constructors in here are intended only for internal use in CXF, others are suitable or preparing attachments to pass to theorg.apache.cxf.jaxrs.client.WebClientAPI. See theAttachmentBuilderfor a convenient way to create attachments for use withorg.apache.cxf.jaxrs.client.WebClient.
-
-
Constructor Summary
Constructors Constructor Description Attachment(InputStream is, javax.ws.rs.core.MultivaluedMap<String,String> headers)Attachment(String id, InputStream is, ContentDisposition cd)Attachment(String mediaType, Object object)Attachment(String id, String mediaType, Object object)Attachment(String id, javax.activation.DataHandler dh, javax.ws.rs.core.MultivaluedMap<String,String> headers)Attachment(String id, javax.activation.DataSource ds, javax.ws.rs.core.MultivaluedMap<String,String> headers)Attachment(javax.ws.rs.core.MultivaluedMap<String,String> headers, Object object)Attachment(javax.ws.rs.core.MultivaluedMap<String,String> headers, javax.activation.DataHandler handler, Object object)Attachment(org.apache.cxf.message.Attachment a, javax.ws.rs.ext.Providers providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ContentDispositiongetContentDisposition()StringgetContentId()javax.ws.rs.core.MediaTypegetContentType()javax.activation.DataHandlergetDataHandler()StringgetHeader(String name)List<String>getHeaderAsList(String name)javax.ws.rs.core.MultivaluedMap<String,String>getHeaders()ObjectgetObject()<T> TgetObject(Class<T> cls)inthashCode()voidsetDataHandler(javax.activation.DataHandler dataHandler)voidtransferTo(File destinationFile)
-
-
-
Constructor Detail
-
Attachment
public Attachment(org.apache.cxf.message.Attachment a, javax.ws.rs.ext.Providers providers)
-
Attachment
public Attachment(String id, javax.activation.DataHandler dh, javax.ws.rs.core.MultivaluedMap<String,String> headers)
-
Attachment
public Attachment(String id, javax.activation.DataSource ds, javax.ws.rs.core.MultivaluedMap<String,String> headers)
-
Attachment
public Attachment(javax.ws.rs.core.MultivaluedMap<String,String> headers, Object object)
-
Attachment
public Attachment(InputStream is, javax.ws.rs.core.MultivaluedMap<String,String> headers)
-
Attachment
public Attachment(String id, InputStream is, ContentDisposition cd)
-
-
Method Detail
-
getContentDisposition
public ContentDisposition getContentDisposition()
-
getContentId
public String getContentId()
-
getContentType
public javax.ws.rs.core.MediaType getContentType()
-
getDataHandler
public javax.activation.DataHandler getDataHandler()
-
setDataHandler
public void setDataHandler(javax.activation.DataHandler dataHandler)
-
getObject
public Object getObject()
-
getObject
public <T> T getObject(Class<T> cls)
-
transferTo
public void transferTo(File destinationFile) throws IOException
- Specified by:
transferToin interfaceorg.apache.cxf.io.Transferable- Throws:
IOException
-
-