本文整理了Java中org.apache.abdera.model.Feed.writeTo()
方法的一些代码示例,展示了Feed.writeTo()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feed.writeTo()
方法的具体详情如下:
包路径:org.apache.abdera.model.Feed
类名称:Feed
方法名:writeTo
暂无
代码示例来源:origin: fcrepo3/fcrepo
private byte[] getAtomObject(String pid, String contentLocation) throws Exception {
Feed feed = createAtomObject(pid, contentLocation);
Writer sWriter = new StringWriter();
feed.writeTo("prettyxml", sWriter);
return sWriter.toString().getBytes("UTF-8");
}
代码示例来源:origin: com.sun.jersey.contribs/jersey-atom-abdera
public void writeTo(Feed feed, Class<?> type, Type genericType,
Annotation[] annotations, MediaType mediaType,
MultivaluedMap<String, Object> headers,
OutputStream stream) throws IOException, WebApplicationException {
if (mediaType.equals(MediaType.APPLICATION_JSON_TYPE) || mediaType.getSubtype().endsWith("+json")) {
feed.writeTo("json", stream);
} else {
feed.writeTo(stream);
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
@Override
public void writeTo(Object message, Class<?> clazz, Type type, Annotation[] annotations, MediaType media, MultivaluedMap<String,Object> httpHeaders,
OutputStream out) throws IOException, WebApplicationException {
if (Entry.class.isAssignableFrom(clazz)) {
Entry entry = (Entry) message;
entry.writeTo(out);
} else if (Feed.class.isAssignableFrom(clazz)) {
Feed feed = (Feed) message;
feed.writeTo(out);
} else if (Service.class.isAssignableFrom(clazz)) {
Service service = (Service) message;
service.writeTo(out);
} else if (Categories.class.isAssignableFrom(clazz)) {
Categories categories = (Categories) message;
categories.writeTo(out);
}
}
代码示例来源:origin: org.fcrepo/fcrepo-server
try {
zout.putNextEntry(new ZipEntry("atommanifest.xml"));
feed.writeTo("prettyxml", zout);
zout.closeEntry();
zout.close();
feed.writeTo("prettyxml", out);
} catch (IOException e) {
throw new StreamIOException(e.getMessage(), e);
代码示例来源:origin: fcrepo3/fcrepo
try {
zout.putNextEntry(new ZipEntry("atommanifest.xml"));
feed.writeTo("prettyxml", zout);
zout.closeEntry();
zout.close();
feed.writeTo("prettyxml", out);
} catch (IOException e) {
throw new StreamIOException(e.getMessage(), e);
代码示例来源:origin: org.dataconservancy.dcs/dcs-ingest-deposit
feed.writeTo(out);
} catch (Exception e) {
throw new RuntimeException("Could not serialize "
代码示例来源:origin: DSpace/DSpace
public InputStream disseminate(Context context, Item item)
throws DSpaceSwordException, SwordError, SwordServerException {
try {
Abdera abdera = new Abdera();
Feed feed = abdera.newFeed();
this.addMetadata(feed, item);
List<Bundle> bundles = item.getBundles();
for (Bundle bundle : bundles) {
if (Constants.CONTENT_BUNDLE_NAME.equals(bundle.getName())) {
List<Bitstream> bitstreams = bundle
.getBitstreams();
for (Bitstream bitstream : bitstreams) {
Entry entry = feed.addEntry();
this.populateEntry(context, entry,
bitstream);
}
}
}
ByteArrayOutputStream baos = new ByteArrayOutputStream();
feed.writeTo(baos);
return new ByteArrayInputStream(baos.toByteArray());
} catch (IOException e) {
throw new DSpaceSwordException(e);
}
}
代码示例来源:origin: org.apache.tuscany.sca/tuscany-binding-atom-runtime
WriterFactory wf = abdera.getWriterFactory();
org.apache.abdera.writer.Writer json = wf.getWriter("json");
feed.writeTo(json, response.getWriter());
} catch (Exception e) {
throw new ServletException(e);
内容来源于网络,如有侵权,请联系作者删除!