-
Notifications
You must be signed in to change notification settings - Fork 64
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
Rename directories when changing process title #5620
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.
Changes look good and did work for entries with and without a processtitle
inside.
Maybe adding a check to compare old and new directory name and do only the renaming if they differ.
Thanks for the review. There already is a similar check in the kitodo-production/Kitodo/src/main/java/org/kitodo/production/forms/ProcessForm.java Line 181 in 766c5eb
Ideally this would be checked inside the renaming function itself to cover all use cases but thanks to the check above the renaming function is already skipped when manually saving a single process without changing the title. Should I change this PR to adjust the code accordingly or leave that change to a separate PR? |
As the renaming functionality of the FileManagement class from the Kitodo-Filemanagement module for files or directories could be called from everywhere I would add even there a check and doing the renaming of files or directories only if they differ. I think that this additional check should be done in the pull request as the comparing should be simple and easy. If this is more complicated than move it to a separate pull request. |
@henning-gerhardt I added a check to skip renaming a directory if the new name equals the old name and a corresponding test. Since the behaviour of renaming files is a little different and does not relate to the changes in this pull request I have not added a similar check, there. |
Kitodo-FileManagement/src/main/java/org/kitodo/filemanagement/FileManagement.java
Outdated
Show resolved
Hide resolved
Kitodo-FileManagement/src/main/java/org/kitodo/filemanagement/FileManagement.java
Outdated
Show resolved
Hide resolved
Kitodo-API/src/main/java/org/kitodo/api/filemanagement/FileManagementInterface.java
Show resolved
Hide resolved
Kitodo-FileManagement/src/main/java/org/kitodo/filemanagement/FileManagement.java
Outdated
Show resolved
Hide resolved
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.
Hopefully last needed change.
Fixes #5597