|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.media.multipart.BodyPart
org.glassfish.jersey.media.multipart.FormDataBodyPart
org.glassfish.jersey.media.multipart.file.FileDataBodyPart
public class FileDataBodyPart
An extension of FormDataBodyPart for associating
File File as a body part entity.
| Field Summary |
|---|
| Fields inherited from class org.glassfish.jersey.media.multipart.BodyPart |
|---|
contentDisposition, messageBodyWorkers |
| Constructor Summary | |
|---|---|
FileDataBodyPart()
A no-args constructor which expects its client to set the values individually, the attributes to be set are fileEntity and name; the media type will be predicted from the fileEntity if not set explicitly. |
|
FileDataBodyPart(String name,
File fileEntity)
Constructs the body part with the provided name and file, it predicts the MediaType of the file provided. |
|
FileDataBodyPart(String name,
File fileEntity,
javax.ws.rs.core.MediaType mediaType)
Constructs the body part with all the attributes set for its proper function. |
|
| Method Summary | |
|---|---|
File |
getFileEntity()
Gets the file for this body part. |
MediaTypePredictor |
getPredictor()
Gets the media type predictor. |
protected javax.ws.rs.core.MediaType |
predictMediaType()
Predicts the media type of the current fileEntity. |
protected javax.ws.rs.core.MediaType |
predictMediaType(File file)
Predicts the media type of the provided File. |
void |
setEntity(Object entity)
This operation is not supported from this implementation. |
void |
setFileEntity(File fileEntity)
Sets the fileEntity for this FormDataBodyPart. |
void |
setFileEntity(File fileEntity,
javax.ws.rs.core.MediaType mediaType)
Sets the MediaType and fileEntity for this FormDataBodyPart. |
void |
setPredictor(MediaTypePredictor predictor)
Sets the media type predictor. |
void |
setValue(javax.ws.rs.core.MediaType mediaType,
Object value)
This operation is not supported from this implementation. |
| Methods inherited from class org.glassfish.jersey.media.multipart.FormDataBodyPart |
|---|
getContentDisposition, getFormDataContentDisposition, getName, getValue, getValueAs, isSimple, setContentDisposition, setFormDataContentDisposition, setName, setValue |
| Methods inherited from class org.glassfish.jersey.media.multipart.BodyPart |
|---|
cleanup, contentDisposition, entity, getEntity, getEntityAs, getHeaders, getMediaType, getParameterizedHeaders, getParent, getProviders, setMediaType, setMessageBodyWorkers, setParent, setProviders, type |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileDataBodyPart()
public FileDataBodyPart(String name,
File fileEntity)
MediaType of the file provided. For the known media types client
will not need to set the media type explicitly.
name - the name of body part.fileEntity - the file that represents the entity.MediaTypePredictor.getMediaTypeFromFile(java.io.File),
FileDataBodyPart(java.lang.String, java.io.File, javax.ws.rs.core.MediaType)
public FileDataBodyPart(String name,
File fileEntity,
javax.ws.rs.core.MediaType mediaType)
throws IllegalArgumentException
name - the name of body part.fileEntity - the file that represents the entity.mediaType - the MediaType of the body part.
IllegalArgumentException - if the fileEntity is null.| Method Detail |
|---|
public File getFileEntity()
public void setValue(javax.ws.rs.core.MediaType mediaType,
Object value)
throws UnsupportedOperationException
setValue in class FormDataBodyPartmediaType - the media type for this field value.value - the field value as a Java object.
UnsupportedOperationException - Operation not supported.setFileEntity(java.io.File, javax.ws.rs.core.MediaType)
public void setEntity(Object entity)
throws UnsupportedOperationException
setEntity in class BodyPartentity - the new entity object.
UnsupportedOperationException - Operation not supported.setFileEntity(java.io.File)public void setFileEntity(File fileEntity)
FormDataBodyPart.
fileEntity - the entity of this FormDataBodyPart.
public void setFileEntity(File fileEntity,
javax.ws.rs.core.MediaType mediaType)
MediaType and fileEntity for this FormDataBodyPart.
fileEntity - the entity of this body part.mediaType - the media type.protected javax.ws.rs.core.MediaType predictMediaType()
MediaType.protected javax.ws.rs.core.MediaType predictMediaType(File file)
File.
file - the file from which the media type is predicted.
MediaType.public MediaTypePredictor getPredictor()
public void setPredictor(MediaTypePredictor predictor)
predictor - the media type predictor.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||