@Override public FormDataContentDisposition build() { return new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size); } }
/** * Overrides the behaviour on {@link BodyPart} to ensure that * only instances of {@link FormDataContentDisposition} can be obtained. * * @return the content disposition. * @throws IllegalArgumentException if the content disposition header cannot be parsed. */ @Override public ContentDisposition getContentDisposition() { if (contentDisposition == null) { String scd = getHeaders().getFirst("Content-Disposition"); if (scd != null) { try { contentDisposition = new FormDataContentDisposition(scd, fileNameFix); } catch (ParseException ex) { throw new IllegalArgumentException(LocalizationMessages.ERROR_PARSING_CONTENT_DISPOSITION(scd), ex); } } } return contentDisposition; }
@Override public FormDataContentDisposition build() { return new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size); } }
@Override public FormDataContentDisposition build() { return new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size); } }
@Override public FormDataContentDisposition build() { return new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size); } }
@Override public FormDataContentDisposition build() { return new FormDataContentDisposition(type, name, fileName, creationDate, modificationDate, readDate, size); } }
StreamDataBodyPart filePart = new StreamDataBodyPart("File.docx", is) { @Override protected FormDataContentDisposition buildContentDisposition() { FormDataContentDisposition contentDisposition = new FormDataContentDisposition("form-data", getName(), getName(), null, null, null, 0) { @Override protected StringBuilder toStringBuffer() { StringBuilder sb = new StringBuilder(); sb.append(this.getType()); addStringParameter(sb, "name", getName()); addStringParameter(sb, "filename", getName()); return sb; } }; return contentDisposition; } };
/** * Overrides the behaviour on {@link BodyPart} to ensure that * only instances of {@link FormDataContentDisposition} can be obtained. * * @return the content disposition. * @throws IllegalArgumentException if the content disposition header cannot be parsed. */ @Override public ContentDisposition getContentDisposition() { if (contentDisposition == null) { String scd = getHeaders().getFirst("Content-Disposition"); if (scd != null) { try { contentDisposition = new FormDataContentDisposition(scd, fileNameFix); } catch (ParseException ex) { throw new IllegalArgumentException(LocalizationMessages.ERROR_PARSING_CONTENT_DISPOSITION(scd), ex); } } } return contentDisposition; }
/** * Overrides the behaviour on {@link BodyPart} to ensure that * only instances of {@link FormDataContentDisposition} can be obtained. * * @return the content disposition. * @throws IllegalArgumentException if the content disposition header cannot be parsed. */ @Override public ContentDisposition getContentDisposition() { if (contentDisposition == null) { String scd = getHeaders().getFirst("Content-Disposition"); if (scd != null) { try { contentDisposition = new FormDataContentDisposition(scd, fileNameFix); } catch (ParseException ex) { throw new IllegalArgumentException(LocalizationMessages.ERROR_PARSING_CONTENT_DISPOSITION(scd), ex); } } } return contentDisposition; }
/** * Overrides the behaviour on {@link BodyPart} to ensure that * only instances of {@link FormDataContentDisposition} can be obtained. * * @return the content disposition. * @throws IllegalArgumentException if the content disposition header cannot be parsed. */ @Override public ContentDisposition getContentDisposition() { if (contentDisposition == null) { String scd = getHeaders().getFirst("Content-Disposition"); if (scd != null) { try { contentDisposition = new FormDataContentDisposition(scd, fileNameFix); } catch (ParseException ex) { throw new IllegalArgumentException(LocalizationMessages.ERROR_PARSING_CONTENT_DISPOSITION(scd), ex); } } } return contentDisposition; }
/** * Overrides the behaviour on {@link BodyPart} to ensure that * only instances of {@link FormDataContentDisposition} can be obtained. * * @return the content disposition. * @throws IllegalArgumentException if the content disposition header cannot be parsed. */ @Override public ContentDisposition getContentDisposition() { if (contentDisposition == null) { String scd = getHeaders().getFirst("Content-Disposition"); if (scd != null) { try { contentDisposition = new FormDataContentDisposition(scd, fileNameFix); } catch (ParseException ex) { throw new IllegalArgumentException(LocalizationMessages.ERROR_PARSING_CONTENT_DISPOSITION(scd), ex); } } } return contentDisposition; }