Replace duplicated literals with manifest constants.

This commit is contained in:
Mark H. Wood
2025-04-01 13:38:47 -04:00
parent fb91feaafe
commit 852549b1f1
9 changed files with 31 additions and 26 deletions

View File

@@ -22,6 +22,7 @@ import org.dspace.content.service.BitstreamFormatService;
import org.dspace.content.service.BitstreamService;
import org.dspace.content.service.CollectionService;
import org.dspace.content.service.ItemService;
import org.dspace.core.Constants;
import org.dspace.core.Context;
import org.dspace.eperson.EPerson;
@@ -139,10 +140,10 @@ public class LicenseUtils {
// Store text as a bitstream
byte[] licenseBytes = licenseText.getBytes("UTF-8");
ByteArrayInputStream bais = new ByteArrayInputStream(licenseBytes);
Bitstream b = itemService.createSingleBitstream(context, bais, item, "LICENSE");
Bitstream b = itemService.createSingleBitstream(context, bais, item, Constants.LICENSE_BUNDLE_NAME);
// Now set the format and name of the bitstream
b.setName(context, "license.txt");
b.setName(context, Constants.LICENSE_BITSTREAM_NAME);
b.setSource(context, "Written by org.dspace.content.LicenseUtils");
DCDate acceptanceDCDate = DCDate.getCurrent();