问题
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