Modify filename of uploaded DSpace submission

人盡茶涼 提交于 2019-12-23 04:54:15

问题


I use DSpace 5.4.

Using Java, how can I change an uploaded submission's file name? I found out that some Flyway database schema migration changed the location of this filename.

As I don't want to run into problems with future database schema migrations, I am looking for solutions that are SQL-agnostic and instead use DSpace's domain objects.


回答1:


To change the name of a file (= a DSpace bitstream) of an archived submission, you could use the example below, given that you know the ID of the bitstream you want to update.

Bitstream bitstream = Bitstream.find(context, bitstreamId);
bitstream.setName("new_name");
bitstream.update();
context.commit();


来源:https://stackoverflow.com/questions/34952946/modify-filename-of-uploaded-dspace-submission

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!