public InputStream getInputStream() throws IOException { return inputPart.getBody(InputStream.class, null); }
public <T> T getFormDataPart(String key, GenericType<T> type) throws IOException { List<InputPart> list = getFormDataMap().get(key); if (list == null || list.isEmpty()) return null; InputPart part = list.get(0); if (part == null) return null; return part.getBody(type); }
public <T> T getFormDataPart(String key, Class<T> rawType, Type genericType) throws IOException { List<InputPart> list = getFormDataMap().get(key); if (list == null || list.isEmpty()) return null; InputPart part = list.get(0); if (part == null) return null; return part.getBody(rawType, genericType); }
@Override public byte[] getAttachmentAsByteArray(String cid) { InputPart inputPart = getInputPart(cid); try { return inputPart.getBody(byte[].class, null); } catch (IOException e) { throw new IllegalArgumentException(Messages.MESSAGES.exceptionWhileExtractionAttachment(cid), e); } }
public Object readFrom(Class<Object> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream, final MultipartRelatedInput xopPackage) throws IOException { try { LogMessages.LOGGER.debugf("Provider : %s, Method : readFrom", getClass().getName()); InputPart rootPart = xopPackage.getRootPart(); JAXBContext jaxb = findJAXBContext(type, annotations, rootPart .getMediaType(), true); Unmarshaller unmarshaller = jaxb.createUnmarshaller(); unmarshaller .setAttachmentUnmarshaller(new XopAttachmentUnmarshaller( xopPackage)); return unmarshaller.unmarshal(new StreamSource(rootPart.getBody( InputStream.class, null))); } catch (JAXBException e) { Response response = Response.serverError().build(); throw new WebApplicationException(e, response); } }
data = part.getBody(field.getType(), field .getGenericType());
map.put(entry.getKey(), entry.getValue().get(0).getBody(rawType, baseType));
list.add(part.getBody(rawType, baseType));
data = part.getBody(type1, method.getGenericParameterTypes()[0]);
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } });
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } });
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } }, -1);
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } });
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } }, -1);
@Override public InputStream getInputStream() throws IOException { return part.getBody(InputStream.class, null); } });
public InputStream getInputStream() throws IOException { return inputPart.getBody(InputStream.class, null); }
public <T> T getFormDataPart(String key, GenericType<T> type) throws IOException { List<InputPart> list = getFormDataMap().get(key); if (list == null || list.isEmpty()) return null; InputPart part = list.get(0); if (part == null) return null; return part.getBody(type); }
public <T> T getFormDataPart(String key, Class<T> rawType, Type genericType) throws IOException { List<InputPart> list = getFormDataMap().get(key); if (list == null || list.isEmpty()) return null; InputPart part = list.get(0); if (part == null) return null; return part.getBody(rawType, genericType); }
@Override public byte[] getAttachmentAsByteArray(String cid) { InputPart inputPart = getInputPart(cid); try { return inputPart.getBody(byte[].class, null); } catch (IOException e) { throw new IllegalArgumentException(Messages.MESSAGES.exceptionWhileExtractionAttachment(cid), e); } }
public static InputStream getStream(MultipartInput input, String key) { try { for (InputPart p : input.getParts()) { String name = MultipartUtils.extractName(p); if (key.equals(name)) { return p.getBody(InputStream.class, null); } } } catch (IOException e) { throw new ConcordApplicationException("Error parsing the request", e); } return null; }