本文整理了Java中org.dspace.content.Bitstream.getID()
方法的一些代码示例,展示了Bitstream.getID()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bitstream.getID()
方法的具体详情如下:
包路径:org.dspace.content.Bitstream
类名称:Bitstream
方法名:getID
暂无
代码示例来源:origin: org.dspace/dspace-xmlui-api
/**
* Return a group id for a bitstream.
*/
protected String getGroupFileID(Bitstream bitstream)
{
return "group_file_" + bitstream.getID();
}
代码示例来源:origin: org.dspace/dspace-xmlui-api
/**
* Return a unique id for the given bitstream
*/
protected String getFileID(Bitstream bitstream)
{
return "file_" + bitstream.getID();
}
代码示例来源:origin: org.dspace/dspace-xmlui-api
/**
* Return a group id for the given bitstream
*/
protected String getGroupFileID(Bitstream bitstream)
{
return "group_file_" + bitstream.getID();
}
代码示例来源:origin: org.dspace/dspace-xmlui-api
/**
* Return a unique id for a bitstream.
*/
protected String getFileID(Bitstream bitstream)
{
return "file_" + bitstream.getID();
}
代码示例来源:origin: DSpace/DSpace
private void checkLastBitstream(Bitstream bitstream) throws SQLException {
if (bitstream != null) {
if (lastBitstream == null) {
lastBitstream = bitstream;
} else if (!lastBitstream.getID().equals(bitstream.getID())) {
numUncache++;
context.uncacheEntity(lastBitstream);
lastBitstream = bitstream;
}
}
}
代码示例来源:origin: DSpace/DSpace
@Override
public int hashCode() {
int hash = 5;
hash += 73 * hash + getType();
hash += 73 * hash + getID().hashCode();
return hash;
}
代码示例来源:origin: DSpace/DSpace
/**
* Return <code>true</code> if <code>other</code> is the same Bitstream
* as this object, <code>false</code> otherwise
*
* @param other object to compare to
* @return <code>true</code> if object passed in represents the same
* collection as this object
*/
@Override
public boolean equals(Object other) {
if (other == null) {
return false;
}
Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(other);
if (this.getClass() != objClass) {
return false;
}
final Bitstream otherBitstream = (Bitstream) other;
if (!this.getID().equals(otherBitstream.getID())) {
return false;
}
return true;
}
代码示例来源:origin: DSpace/DSpace
protected String urlOfBitstream(HttpServletRequest request, Bitstream logo) {
String name = logo.getName();
return resolveURL(request, null) +
(uiType.equalsIgnoreCase(UITYPE_XMLUI) ? "/bitstream/id/" : "/retrieve/") +
logo.getID() + "/" + (name == null ? "" : name);
}
代码示例来源:origin: DSpace/DSpace
public String getActionableBitstreamUrl(Bitstream bitstream)
throws DSpaceSwordException {
return this.getSwordBaseUrl() + "/edit-media/bitstream/" +
bitstream.getID() + "/" + bitstream.getName();
}
代码示例来源:origin: DSpace/DSpace
@Override
public List<Bitstream> findDuplicateInternalIdentifier(Context context, Bitstream bitstream) throws SQLException {
CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context);
CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, Bitstream.class);
Root<Bitstream> bitstreamRoot = criteriaQuery.from(Bitstream.class);
criteriaQuery.select(bitstreamRoot);
criteriaQuery.where(criteriaBuilder.and(
criteriaBuilder.equal(bitstreamRoot.get(Bitstream_.internalId), bitstream.getInternalId()),
criteriaBuilder.notEqual(bitstreamRoot.get(Bitstream_.id), bitstream.getID())
)
);
return list(context, criteriaQuery, false, Bitstream.class, -1, -1);
}
代码示例来源:origin: DSpace/DSpace
@Override
public void updateLastModified(Context context, Bitstream bitstream) {
//Also fire a modified event since the bitstream HAS been modified
context.addEvent(
new Event(Event.MODIFY, Constants.BITSTREAM, bitstream.getID(), null, getIdentifiers(context, bitstream)));
}
代码示例来源:origin: DSpace/DSpace
buf.append("------------------------------------------------ \n");
buf.append(msg("bitstream-id")).append(" = ").append(
mostRecentChecksum.getBitstream().getID()).append("\n");
buf.append(msg("process-start-date")).append(" = ").append(
applyDateFormatLong(mostRecentChecksum.getProcessStartDate()))
代码示例来源:origin: DSpace/DSpace
/**
* Find out whether bitstream is readable by the public.
*
* @param bitstream the target bitstream
* @return whether bitstream is readable by the Anonymous group
*/
protected boolean isPublic(Bitstream bitstream) {
if (bitstream == null) {
return false;
}
boolean result = false;
Context context = null;
try {
context = new Context();
result = AuthorizeServiceFactory.getInstance().getAuthorizeService()
.authorizeActionBoolean(context, bitstream, Constants.READ, true);
} catch (SQLException e) {
log.error(
"Cannot determine whether bitstream is public, assuming it isn't. bitstream_id=" + bitstream.getID(),
e);
}
return result;
}
代码示例来源:origin: DSpace/DSpace
@Override
public void delete(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
// changed to a check on delete
// Check authorisation
authorizeService.authorizeAction(context, bitstream, Constants.DELETE);
log.info(LogManager.getHeader(context, "delete_bitstream",
"bitstream_id=" + bitstream.getID()));
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
// Remove bitstream itself
bitstream.setDeleted(true);
update(context, bitstream);
//Remove our bitstream from all our bundles
final List<Bundle> bundles = bitstream.getBundles();
for (Bundle bundle : bundles) {
bundle.removeBitstream(bitstream);
}
//Remove all bundles from the bitstream object, clearing the connection in 2 ways
bundles.clear();
// Remove policies only after the bitstream has been updated (otherwise the current user has not WRITE rights)
authorizeService.removeAllPolicies(context, bitstream);
}
代码示例来源:origin: DSpace/DSpace
+ bundle.getID() + ",bitstream_id=" + bitstream.getID()));
if (bitstream.getID().equals(bs.getID())) {
Constants.BITSTREAM, bitstream.getID(), String.valueOf(bitstream.getSequenceID()),
getIdentifiers(context, bundle)));
代码示例来源:origin: DSpace/DSpace
UUID bitstreamId = bitstream.getID();
代码示例来源:origin: DSpace/DSpace
@Override
public void update(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
// Check authorisation
authorizeService.authorizeAction(context, bitstream, Constants.WRITE);
log.info(LogManager.getHeader(context, "update_bitstream",
"bitstream_id=" + bitstream.getID()));
super.update(context, bitstream);
if (bitstream.isModified()) {
context.addEvent(new Event(Event.MODIFY, Constants.BITSTREAM, bitstream.getID(), null,
getIdentifiers(context, bitstream)));
bitstream.setModified();
}
if (bitstream.isMetadataModified()) {
context.addEvent(
new Event(Event.MODIFY_METADATA, Constants.BITSTREAM, bitstream.getID(), bitstream.getDetails(),
getIdentifiers(context, bitstream)));
bitstream.clearModified();
bitstream.clearDetails();
}
bitstreamDAO.save(context, bitstream);
}
代码示例来源:origin: DSpace/DSpace
+ newLogo.getID()));
代码示例来源:origin: DSpace/DSpace
private UUID mapType(int type, int val) throws SQLException {
if (type == Constants.COMMUNITY) {
Community comm = communityService.findByLegacyId(context, val);
return comm == null ? null : comm.getID();
}
if (type == Constants.COLLECTION) {
org.dspace.content.Collection coll = collectionService.findByLegacyId(context, val);
return coll == null ? null : coll.getID();
}
if (type == Constants.ITEM) {
Item item = itemService.findByLegacyId(context, val);
checkLastItem(item);
return item == null ? null : item.getID();
}
if (type == Constants.BITSTREAM) {
Bitstream bit = bitstreamService.findByLegacyId(context, val);
UUID uuid = bit == null ? null : bit.getID();
// A bitstream is unlikely to be processed more than once, to clear immediately
checkLastBitstream(bit);
return uuid;
}
return null;
}
代码示例来源:origin: DSpace/DSpace
+ newLogo.getID()));
内容来源于网络,如有侵权,请联系作者删除!