diff --git a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java index 9a6582c2966..5f4967f56e1 100644 --- a/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java +++ b/src/main/java/edu/harvard/iq/dataverse/EditDatafilesPage.java @@ -2290,6 +2290,8 @@ private String processUploadedFileList(List dFileList) { // deleteTempFile(dataFile); dataFile.setMarkedAsDuplicate(true); dataFile.getFileMetadata().setMarkedAsDuplicate(true); + String inLineMessage = getBundleString("dataset.file.inline.message.prefix") + " " + existingFile.getDisplayName(); + dataFile.setDuplicateFilename(inLineMessage); } else { // OK, this one is not a duplicate, we want it. // But let's check if its filename is a duplicate of another @@ -2360,7 +2362,7 @@ private String processUploadedFileList(List dFileList) { List args = Arrays.asList(uploadedFilesWithDupeContentToExisting, existingFilesWithDupeContent); if (multipleDupesExisting) { - duplicateFilesErrorMessage = BundleUtil.getStringFromBundle("dataset.files.exis", args); + duplicateFilesErrorMessage = BundleUtil.getStringFromBundle("dataset.files.exist", args); } else { duplicateFilesErrorMessage = BundleUtil.getStringFromBundle("dataset.file.exist", args); } @@ -2370,22 +2372,23 @@ private String processUploadedFileList(List dFileList) { warningMessage = warningMessage.concat("; " + duplicateFilesErrorMessage); } } -/* - if (dupeFileNamesNew != null) { + + if (newlyUploadedFilesWithDupeContent != null) { String duplicateFilesErrorMessage = null; - if (multipleDupesNew) { - duplicateFilesErrorMessage = getBundleString("dataset.files.duplicate") + dupeFileNamesNew ; + List args = Arrays.asList(newlyUploadedFilesWithDupeContent, uploadedFilesWithDupeContentToNewlyUploaded); + + if (multipleDupesNew) { + duplicateFilesErrorMessage = BundleUtil.getStringFromBundle("dataset.files.duplicate", args); } else { - duplicateFilesErrorMessage = getBundleString("dataset.file.duplicate") + dupeFileNamesNew ; + duplicateFilesErrorMessage = BundleUtil.getStringFromBundle("dataset.file.duplicate", args); } - if (warningMessage == null) { warningMessage = duplicateFilesErrorMessage; } else { warningMessage = warningMessage.concat("; " + duplicateFilesErrorMessage); } } -*/ + if (warningMessage != null) { logger.severe(warningMessage); return warningMessage; diff --git a/src/main/java/propertyFiles/Bundle.properties b/src/main/java/propertyFiles/Bundle.properties index 27da86dcd74..0e3534562dc 100755 --- a/src/main/java/propertyFiles/Bundle.properties +++ b/src/main/java/propertyFiles/Bundle.properties @@ -2111,8 +2111,8 @@ dataset.save.fail=Dataset Save Failed dataset.files.exist=Files {0} have the same content as {1} that already exist in the dataset. dataset.file.exist=File {0} has the same content as {1} that already exists in the dataset. -dataset.files.duplicate=The following files have content identical to (an) already uploaded file(s): -dataset.file.duplicate=The following file has identical content to an already uploaded file: +dataset.files.duplicate=Files {0} have the same content as {1} that have already been uploaded. +dataset.file.duplicate=File {0} has the same content as {1} that has already been uploaded. dataset.file.inline.message.prefix= This file has the same content as dataset.file.skip=(skipping) dataset.file.upload=Succesful {0} is uploaded.