本文整理了Java中org.apache.camel.WrappedFile
类的一些代码示例,展示了WrappedFile
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WrappedFile
类的具体详情如下:
包路径:org.apache.camel.WrappedFile
类名称:WrappedFile
暂无
代码示例来源:origin: org.apache.camel/camel-jclouds
@FallbackConverter
@SuppressWarnings("unchecked")
public static <T extends Payload> T convertTo(Class<T> type, Exchange exchange, Object value, TypeConverterRegistry registry) throws IOException {
Class<?> sourceType = value.getClass();
if (type == Payload.class && WrappedFile.class.isAssignableFrom(sourceType)) {
// attempt to convert to JClouds Payload from a file
WrappedFile wf = (WrappedFile) value;
if (wf.getFile() != null) {
TypeConverter converter = registry.lookup(Payload.class, wf.getFile().getClass());
if (converter != null) {
return (T) converter.tryConvertTo(Payload.class, wf.getFile());
}
}
}
return null;
}
}
代码示例来源:origin: org.apache.camel/camel-azure
private InputStream getInputStreamFromExchange(Exchange exchange) throws Exception {
Object body = exchange.getIn().getBody();
if (body instanceof WrappedFile) {
// unwrap file
body = ((WrappedFile) body).getFile();
}
InputStream is;
if (body instanceof InputStream) {
is = (InputStream) body;
} else if (body instanceof File) {
is = new FileInputStream((File)body);
} else if (body instanceof byte[]) {
is = new ByteArrayInputStream((byte[]) body);
} else {
// try as input stream
is = exchange.getContext().getTypeConverter().tryConvertTo(InputStream.class, exchange, body);
}
if (is == null) {
// fallback to string based
throw new IllegalArgumentException("Unsupported blob type:" + body.getClass().getName());
}
return is;
}
代码示例来源:origin: org.openehealth.ipf.platform-camel/ipf-platform-camel-ihe-hl7v2
s = readFile(body, charset);
} else if(body instanceof WrappedFile<?>) {
Object file = ((WrappedFile<?>) body).getFile();
if(file instanceof File) {
s = readFile(file, charset);
代码示例来源:origin: org.apache.camel/camel-tarfile
body = ((WrappedFile) body).getFile();
代码示例来源:origin: org.apache.camel/camel-zipfile
body = ((WrappedFile) body).getFile();
代码示例来源:origin: org.apache.camel/camel-solr
boolean invalid = false;
if (body instanceof WrappedFile) {
body = ((WrappedFile<?>) body).getFile();
代码示例来源:origin: io.konig/konig-camel-aws-s3
obj = ((WrappedFile<?>)obj).getFile();
代码示例来源:origin: io.konig/konig-camel-aws-s3
obj = ((WrappedFile<?>)obj).getFile();
内容来源于网络,如有侵权,请联系作者删除!