Skip to content

Renaming a file can rename also another similar file #540

@optyfr

Description

@optyfr

suppose I have 2 entries :

  • abcd.tmp
  • abcd.tmp0

If I rename abcd.tmp to bcde.tmp, then abcd.tmp0 is also renamed to bcde.tmp0 !!!

This is probably related to this line :

if (fileHeaderToBeChecked.getFileName().startsWith(fileHeaderToBeRenamed.getKey())) {

Every file headers that starts with the file to rename are matching, and so they get renamed by overwritting with the new name up to the len of the new name

Replacing startsWith method with equals should solve the problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions