本文整理了Java中org.dspace.content.Bitstream.setSource()
方法的一些代码示例,展示了Bitstream.setSource()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bitstream.setSource()
方法的具体详情如下:
包路径:org.dspace.content.Bitstream
类名称:Bitstream
方法名:setSource
[英]Set the source of the bitstream
[中]设置位流的源
代码示例来源:origin: DSpace/DSpace
newBitstream.setDescription(context, bitstream.getDescription());
newBitstream.setFormat(context, bitstream.getFormat(context));
newBitstream.setSource(context, bitstream.getSource());
newBitstream.setUserFormatDescription(context, bitstream
.getUserFormatDescription());
代码示例来源:origin: DSpace/DSpace
@Override
public void setLicense(Context context, Item item,
InputStream licenseStm, String mimeType)
throws SQLException, IOException, AuthorizeException {
Bundle bundle = getCcBundle(context, item);
// set the format
BitstreamFormat bs_format;
if (mimeType.equalsIgnoreCase("text/xml")) {
bs_format = bitstreamFormatService.findByShortDescription(context, "CC License");
} else if (mimeType.equalsIgnoreCase("text/rdf")) {
bs_format = bitstreamFormatService.findByShortDescription(context, "RDF XML");
} else {
bs_format = bitstreamFormatService.findByShortDescription(context, "License");
}
Bitstream bs = bitstreamService.create(context, bundle, licenseStm);
bs.setSource(context, CC_BS_SOURCE);
bs.setName(context, (mimeType != null &&
(mimeType.equalsIgnoreCase("text/xml") ||
mimeType.equalsIgnoreCase("text/rdf"))) ?
BSN_LICENSE_RDF : BSN_LICENSE_TEXT);
bs.setFormat(context, bs_format);
bitstreamService.update(context, bs);
}
代码示例来源:origin: DSpace/DSpace
/**
* This helper method takes some bytes and stores them as a bitstream for an
* item, under the CC bundle, with the given bitstream name
*
* Note: This helper method assumes that the CC
* bitstreams are short and easily expressed as byte arrays in RAM
*
* @param context The relevant DSpace Context.
* @param item parent item
* @param bundle parent bundle
* @param bitstream_name bitstream name to set
* @param format bitstream format
* @param bytes bitstream data
* @throws IOException A general class of exceptions produced by failed or interrupted I/O operations.
* @throws SQLException An exception that provides information on a database access error or other errors.
* @throws AuthorizeException Exception indicating the current user of the context does not have permission
* to perform a particular action.
*/
protected void setBitstreamFromBytes(Context context, Item item, Bundle bundle,
String bitstream_name, BitstreamFormat format, byte[] bytes)
throws SQLException, IOException, AuthorizeException {
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
Bitstream bs = bitstreamService.create(context, bundle, bais);
bs.setName(context, bitstream_name);
bs.setSource(context, CC_BS_SOURCE);
bs.setFormat(context, format);
// commit everything
bitstreamService.update(context, bs);
}
代码示例来源:origin: DSpace/DSpace
lbs.setSource(context, Constants.LICENSE_BITSTREAM_NAME);
bitstreamService.update(context, lbs);
代码示例来源:origin: org.dspace/dspace-jspui-api
bitstream.setSource(source);
bitstream.setDescription(desc);
bitstream
代码示例来源:origin: DSpace/DSpace
bitstream.setName(context, value);
} else if (dcField.equals("title.alternative")) {
bitstream.setSource(context, value);
} else if (dcField.equals("description")) {
bitstream.setDescription(context, value);
代码示例来源:origin: DSpace/DSpace
b.setSource(context, "Written by org.dspace.content.LicenseUtils");
代码示例来源:origin: org.dspace/dspace-jspui-api
logoBS.setSource(wrapper.getFilesystemName("file"));
代码示例来源:origin: org.dspace/dspace-jspui-api
b.setSource(wrapper.getFilesystemName("file"));
代码示例来源:origin: DSpace/DSpace
dspaceBitstream.setSource(context, "DSpace REST API");
代码示例来源:origin: DSpace/DSpace
b.setSource(context, "Written by FormatFilter " + formatFilter.getClass().getName() +
" on " + DCDate.getCurrent() + " (GMT).");
b.setDescription(context, formatFilter.getDescription());
代码示例来源:origin: org.dspace/dspace-jspui-api
logoBS.setSource(wrapper.getFilesystemName("file"));
代码示例来源:origin: org.dspace/dspace-xmlui-api
bitstream.setSource(filePart.getUploadName());
bitstream.setDescription(request.getParameter("description"));
代码示例来源:origin: DSpace/DSpace
.getMetsAsStream());
manifestBitstream.setName(context, METSManifest.MANIFEST_FILE);
manifestBitstream.setSource(context, METSManifest.MANIFEST_FILE);
bitstreamService.update(context, manifestBitstream);
内容来源于网络,如有侵权,请联系作者删除!