Reputation: 27862
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.
Upvotes: 0
Views: 219
Reputation:
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();
Upvotes: 1