-
Notifications
You must be signed in to change notification settings - Fork 486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
6574 filenames #6893
6574 filenames #6893
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested some code consolidation. overall looks good.
*/ | ||
public static boolean conflictsWithExistingFilenames(String label, String directoryLabel, List<FileMetadata> fileMetadatas, DataFile dataFile) { | ||
List<String> filePathsAndNames = new ArrayList<>(); | ||
for (FileMetadata fileMetadata : fileMetadatas) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it be possible to combine this with findDuplicateFilenames so that the UI and api are using the same method? You're passing in the filemetadata list from the dataset version which is the param for findDuplicateFilenames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sekmiller good idea. Fixed in 8d6a5c8.
What this PR does / why we need it:
Several bugs were found while investigating filenames:
Which issue(s) this PR closes:
Closes #6574
Special notes for your reviewer:
Methods are in IngestUtil because that's where similar methods are found. Previous methods were focused on returning a unique filename such as README-1.md. The new methods are focused on identifying duplicates.
Suggestions on how to test this:
Try exercising the bugs above on develop vs. this branch. The API to use is this one, passing "label" and "directoryLabel" in the JSON: http://guides.dataverse.org/en/4.20/api/native-api.html#updating-file-metadata
Does this PR introduce a user interface change?:
Yes, if you try to rename a file to create a naming conflict, you will see an error like this:
Is there a release notes update needed for this change?:
I don't believe so.
Additional documentation:
None.