@Override public byte[] get() throws IOException { return fileUpload.get(); }
public static MultipartFile create(FileUpload fileUpload) { try { MultipartFile _file = new MultipartFile(); _file.setContent(fileUpload.get()); _file.setContentType(fileUpload.getContentType()); _file.setSize(fileUpload.length()); _file.setName(fileUpload.getFilename()); return _file; } catch (Exception ex) { // ignore exception } return null; } }
private void handleUploadFile(InterfaceHttpData data, Message uploadMessage) throws IOException{ FileForm fileForm = uploadMessage.fileForm; if(uploadMessage.fileForm == null){ uploadMessage.fileForm = fileForm = new FileForm(); } if (data.getHttpDataType() == HttpDataType.Attribute) { Attribute attribute = (Attribute) data; fileForm.attributes.put(attribute.getName(), attribute.getValue()); return; } if (data.getHttpDataType() == HttpDataType.FileUpload) { FileUpload fileUpload = (FileUpload) data; Message.FileUpload file = new Message.FileUpload(); file.fileName = fileUpload.getFilename(); file.contentType = fileUpload.getContentType(); file.data = fileUpload.get(); List<Message.FileUpload> uploads = fileForm.files.get(data.getName()); if(uploads == null){ uploads = new ArrayList<Message.FileUpload>(); fileForm.files.put(data.getName(), uploads); } uploads.add(file); } }
@Override public byte[] get() throws IOException { return fileUpload.get(); }
@Override public byte[] bytes() { try { return upload.get(); } catch (IOException e) { //NOSONAR return null; } }
@Override public byte[] get() throws IOException { return fileUpload.get(); }
@Override public byte[] get() throws IOException { return fileUpload.get(); }
@Override public byte[] get() throws IOException { return fileUpload.get(); }