Skip to content

MoveHandler MoveAsync for collections copies children individually (potentially very slow for some backing stores) #19

Closed
@CaptainPants

Description

MoveHandler move function for collections has no option to take advantage of moving a whole container, but instead creates a new container, moves contents one at a time, and then deletes the original.

I am working on a personal project that has an option for a GoogleDrive backing store. I would prefer to simply change the parent of the folder, retaining the ID of the folder itself.

https://github.com/ramondeklein/nwebdav/blob/master/NWebDav.Server/Handlers/MoveHandler.cs

This function:
private async Task MoveAsync(IStoreCollection sourceCollection, string sourceName, IStoreCollection destinationCollection, string destinationName, bool overwrite, IHttpContext httpContext, Uri baseUri, UriResultCollection errors)

I am happy to make the change in a branch and add a pull request, but would ideally like to coordinate on design.

My thinking is to add a function to IStoreCollection to check if a 'fast move' of a child collection is supported, and if so just tell it to use MoveItemAsync on the parent collection to do the move (the same as if it was a file). E.g. Task SupportsMovingCollections().

If I am just missing something and there is already an easier way, please let me know.

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