/** * Create an object of {@link InterfaceHttpData} to build Netty multipart request. * * @see Part#getData(HttpRequest, HttpDataFactory) */ @Override InterfaceHttpData getData(HttpRequest request, HttpDataFactory factory) { MediaType mediaType = contentType; String contentType = mediaType.toString(); String encoding = mediaType.isTextBased() ? null : "binary"; FileUpload fileUpload = factory.createFileUpload(request, name, filename, contentType, encoding, null, getLength()); try { setContent(fileUpload); } catch (IOException e) { throw new IllegalArgumentException(e); } return fileUpload; } }
/** * Create an object of {@link InterfaceHttpData} to build Netty multipart request. * * @see Part#getData(HttpRequest, HttpDataFactory) */ @Override InterfaceHttpData getData(HttpRequest request, HttpDataFactory factory) { MediaType mediaType = contentType; String contentType = mediaType.toString(); String encoding = mediaType.isTextBased() ? null : "binary"; FileUpload fileUpload = factory.createFileUpload(request, name, filename, contentType, encoding, null, getLength()); try { setContent(fileUpload); } catch (IOException e) { throw new IllegalArgumentException(e); } return fileUpload; } }
/** * Create an object of {@link InterfaceHttpData} to build Netty multipart request. * * @see Part#getData(HttpRequest, HttpDataFactory) */ @Override InterfaceHttpData getData(HttpRequest request, HttpDataFactory factory) { MediaType mediaType = contentType; String contentType = mediaType.toString(); String encoding = mediaType.isTextBased() ? null : "binary"; FileUpload fileUpload = factory.createFileUpload(request, name, filename, contentType, encoding, null, getLength()); try { setContent(fileUpload); } catch (IOException e) { throw new IllegalArgumentException(e); } return fileUpload; } }