Skip to content

NIOFileSystem: Make it clear in the docs (or possibly rename the API) that replaceItem _moves_ an item #3406

@weissi

Description

@weissi

NIOFileSystem has two APIs:

  • moveItem
  • replaceItem

It was immediately obvious to me that moveItem moves the source to the destination, i.e. source is gone after the move.

But for replaceItem, I thought that it would only replace the destination and leave the source intact. In reality however, replaceItem is the same as moveItem, except that it also removes the destination if it already exists.

Really, I think whether replacing the destination is okay should be a parameter to moveItem and not a separate replaceItem API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions