本文整理了Java中org.apache.cxf.jaxrs.ext.multipart.Multipart.value()
方法的一些代码示例,展示了Multipart.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Multipart.value()
方法的具体详情如下:
包路径:org.apache.cxf.jaxrs.ext.multipart.Multipart
类名称:Multipart
方法名:value
暂无
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
private String getContentId(Annotation[] anns, int id) {
Multipart part = AnnotationUtils.getAnnotation(anns, Multipart.class);
if (part != null && !"".equals(part.value())) {
return part.value();
}
return id == 0 ? AttachmentUtil.BODY_ATTACHMENT_ID : Integer.toString(id);
}
代码示例来源:origin: apache/cxf
private String getContentId(Annotation[] anns, int id) {
Multipart part = AnnotationUtils.getAnnotation(anns, Multipart.class);
if (part != null && !"".equals(part.value())) {
return part.value();
}
return id == 0 ? AttachmentUtil.BODY_ATTACHMENT_ID : Integer.toString(id);
}
代码示例来源:origin: apache/cxf
public static Attachment getFirstMatchingPart(MessageContext mc, Multipart id) {
return getFirstMatchingPart(mc, id.value());
}
代码示例来源:origin: apache/cxf
public static boolean matchAttachmentId(Attachment at, Multipart mid) {
return matchAttachmentId(at, mid.value());
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static Attachment getFirstMatchingPart(MessageContext mc, Multipart id) {
return getFirstMatchingPart(mc, id.value());
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static boolean matchAttachmentId(Attachment at, Multipart mid) {
return matchAttachmentId(at, mid.value());
}
代码示例来源:origin: apache/cxf
public static List<Attachment> getMatchingAttachments(Multipart id,
List<Attachment> infos) {
return getMatchingAttachments(id.value(), id.type(), infos);
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static List<Attachment> getMatchingAttachments(Multipart id,
List<Attachment> infos) {
return getMatchingAttachments(id.value(), id.type(), infos);
}
代码示例来源:origin: org.apache.camel/camel-cxf
Multipart multipart = (Multipart) a;
answer.multipart = true;
answer.multipartNames[i] = multipart.value();
answer.multipartTypes[i] = multipart.type();
代码示例来源:origin: apache/cxf
protected List<Attachment> handleMultipart(MultivaluedMap<ParameterType, Parameter> map,
OperationResourceInfo ori,
Object[] params) {
List<Attachment> atts = new LinkedList<>();
List<Parameter> fm = getParameters(map, ParameterType.REQUEST_BODY);
fm.forEach(p -> {
Multipart part = getMultipart(ori, p.getIndex());
if (part != null) {
Object partObject = params[p.getIndex()];
if (partObject != null) {
atts.add(new Attachment(part.value(), part.type(), partObject));
}
}
});
return atts;
}
代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client
protected List<Attachment> handleMultipart(MultivaluedMap<ParameterType, Parameter> map,
OperationResourceInfo ori,
Object[] params) {
List<Attachment> atts = new LinkedList<>();
List<Parameter> fm = getParameters(map, ParameterType.REQUEST_BODY);
fm.forEach(p -> {
Multipart part = getMultipart(ori, p.getIndex());
if (part != null) {
Object partObject = params[p.getIndex()];
if (partObject != null) {
atts.add(new Attachment(part.value(), part.type(), partObject));
}
}
});
return atts;
}
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
Multipart m = AnnotationUtils.getAnnotation(anns, Multipart.class);
if (m != null) {
paramName = m.value();
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
private List<Attachment> handleMultipart(MultivaluedMap<ParameterType, Parameter> map,
OperationResourceInfo ori,
Object[] params) {
List<Attachment> atts = new LinkedList<Attachment>();
List<Parameter> fm = getParameters(map, ParameterType.REQUEST_BODY);
for (Parameter p : fm) {
Multipart part = getMultipart(ori, p.getIndex());
if (part != null) {
Object objectPart = params[p.getIndex()];
if (objectPart != null) {
atts.add(new Attachment(part.value(), part.type(), objectPart));
}
}
}
return atts;
}
代码示例来源:origin: apache/cxf
public static Attachment getMultipart(Multipart id,
MediaType mt,
List<Attachment> infos) throws IOException {
if (id != null) {
for (Attachment a : infos) {
if (matchAttachmentId(a, id)) {
checkMediaTypes(a.getContentType(), id.type());
return a;
}
}
if (id.required()) {
org.apache.cxf.common.i18n.Message errorMsg =
new org.apache.cxf.common.i18n.Message("MULTTIPART_ID_NOT_FOUND",
BUNDLE,
id.value(),
mt.toString());
LOG.warning(errorMsg.toString());
throw ExceptionUtils.toBadRequestException(
new MultipartReadException(id.value(), id.type(), errorMsg.toString()), null);
}
return null;
}
return !infos.isEmpty() ? infos.get(0) : null;
}
代码示例来源:origin: apache/cxf
Multipart m = AnnotationUtils.getAnnotation(anns, Multipart.class);
if (m != null) {
paramName = m.value();
代码示例来源:origin: org.apache.cxf/cxf-rt-rs-service-description
Multipart m = AnnotationUtils.getAnnotation(anns, Multipart.class);
if (m != null) {
paramName = m.value();
代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs
public static Attachment getMultipart(Multipart id,
MediaType mt,
List<Attachment> infos) throws IOException {
if (id != null) {
for (Attachment a : infos) {
if (matchAttachmentId(a, id)) {
checkMediaTypes(a.getContentType(), id.type());
return a;
}
}
if (id.required()) {
org.apache.cxf.common.i18n.Message errorMsg =
new org.apache.cxf.common.i18n.Message("MULTTIPART_ID_NOT_FOUND",
BUNDLE,
id.value(),
mt.toString());
LOG.warning(errorMsg.toString());
throw ExceptionUtils.toBadRequestException(
new MultipartReadException(id.value(), id.type(), errorMsg.toString()), null);
} else {
return null;
}
}
return infos.size() > 0 ? infos.get(0) : null;
}
内容来源于网络,如有侵权,请联系作者删除!