/** * Sets the fileEntity for this {@link FormDataBodyPart}. * * @param fileEntity the entity of this {@link FormDataBodyPart}. */ public void setFileEntity(final File fileEntity) { this.setFileEntity(fileEntity, predictMediaType()); }
/** * Predicts the media type of the current fileEntity. * * @return predicted {@link MediaType}. */ protected MediaType predictMediaType() { return predictMediaType(getFileEntity()); }
/** * Constructs the body part with all the attributes set for its proper * function. If this constructor is used to construct the body part then it * is not required to set any other attributes for proper behavior. * * @param name the name of body part. * @param fileEntity the file that represents the entity. * @param mediaType the {@link MediaType} of the body part. * @throws java.lang.IllegalArgumentException if the fileEntity is {@code null}. */ public FileDataBodyPart(final String name, final File fileEntity, final MediaType mediaType) throws IllegalArgumentException { super(); super.setName(name); if (mediaType != null) { setFileEntity(fileEntity, mediaType); } else { setFileEntity(fileEntity, predictMediaType(fileEntity)); } }
/** * Sets the fileEntity for this {@link FormDataBodyPart}. * * @param fileEntity the entity of this {@link FormDataBodyPart}. */ public void setFileEntity(final File fileEntity) { this.setFileEntity(fileEntity, predictMediaType()); }
/** * Predicts the media type of the current fileEntity. * * @return predicted {@link MediaType}. */ protected MediaType predictMediaType() { return predictMediaType(getFileEntity()); }
/** * Sets the fileEntity for this {@link FormDataBodyPart}. * * @param fileEntity the entity of this {@link FormDataBodyPart}. */ public void setFileEntity(final File fileEntity) { this.setFileEntity(fileEntity, predictMediaType()); }
/** * Predicts the media type of the current fileEntity. * * @return predicted {@link MediaType}. */ protected MediaType predictMediaType() { return predictMediaType(getFileEntity()); }
/** * Sets the fileEntity for this {@link FormDataBodyPart}. * * @param fileEntity the entity of this {@link FormDataBodyPart}. */ public void setFileEntity(final File fileEntity) { this.setFileEntity(fileEntity, predictMediaType()); }
/** * Predicts the media type of the current fileEntity. * * @return predicted {@link MediaType}. */ protected MediaType predictMediaType() { return predictMediaType(getFileEntity()); }
/** * Sets the fileEntity for this {@link FormDataBodyPart}. * * @param fileEntity the entity of this {@link FormDataBodyPart}. */ public void setFileEntity(final File fileEntity) { this.setFileEntity(fileEntity, predictMediaType()); }
/** * Predicts the media type of the current fileEntity. * * @return predicted {@link MediaType}. */ protected MediaType predictMediaType() { return predictMediaType(getFileEntity()); }
/** * Constructs the body part with all the attributes set for its proper * function. If this constructor is used to construct the body part then it * is not required to set any other attributes for proper behavior. * * @param name the name of body part. * @param fileEntity the file that represents the entity. * @param mediaType the {@link MediaType} of the body part. * @throws java.lang.IllegalArgumentException if the fileEntity is {@code null}. */ public FileDataBodyPart(final String name, final File fileEntity, final MediaType mediaType) throws IllegalArgumentException { super(); super.setName(name); if (mediaType != null) { setFileEntity(fileEntity, mediaType); } else { setFileEntity(fileEntity, predictMediaType(fileEntity)); } }
/** * Constructs the body part with all the attributes set for its proper * function. If this constructor is used to construct the body part then it * is not required to set any other attributes for proper behavior. * * @param name the name of body part. * @param fileEntity the file that represents the entity. * @param mediaType the {@link MediaType} of the body part. * @throws java.lang.IllegalArgumentException if the fileEntity is {@code null}. */ public FileDataBodyPart(final String name, final File fileEntity, final MediaType mediaType) throws IllegalArgumentException { super(); super.setName(name); if (mediaType != null) { setFileEntity(fileEntity, mediaType); } else { setFileEntity(fileEntity, predictMediaType(fileEntity)); } }
/** * Constructs the body part with all the attributes set for its proper * function. If this constructor is used to construct the body part then it * is not required to set any other attributes for proper behavior. * * @param name the name of body part. * @param fileEntity the file that represents the entity. * @param mediaType the {@link MediaType} of the body part. * @throws java.lang.IllegalArgumentException if the fileEntity is {@code null}. */ public FileDataBodyPart(final String name, final File fileEntity, final MediaType mediaType) throws IllegalArgumentException { super(); super.setName(name); if (mediaType != null) { setFileEntity(fileEntity, mediaType); } else { setFileEntity(fileEntity, predictMediaType(fileEntity)); } }
/** * Constructs the body part with all the attributes set for its proper * function. If this constructor is used to construct the body part then it * is not required to set any other attributes for proper behavior. * * @param name the name of body part. * @param fileEntity the file that represents the entity. * @param mediaType the {@link MediaType} of the body part. * @throws java.lang.IllegalArgumentException if the fileEntity is {@code null}. */ public FileDataBodyPart(final String name, final File fileEntity, final MediaType mediaType) throws IllegalArgumentException { super(); super.setName(name); if (mediaType != null) { setFileEntity(fileEntity, mediaType); } else { setFileEntity(fileEntity, predictMediaType(fileEntity)); } }