Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Add support for move operation #93

Merged
merged 7 commits into from
Sep 10, 2014
Merged

Add support for move operation #93

merged 7 commits into from
Sep 10, 2014

Conversation

lavelle
Copy link
Contributor

@lavelle lavelle commented Sep 9, 2014

This implements non-recursive move for S3 and WebDAV.

@lavelle lavelle mentioned this pull request Sep 9, 2014
9 tasks
@lavelle
Copy link
Contributor Author

lavelle commented Sep 9, 2014

Ready for review

webDAVFS.moveEntry({
sourcePath: options.sourcePath.substring(1),
targetPath: options.targetPath.substring(1),
onSuccess: function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be simply written as onSuccess: onSuccess

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've used this redundant pattern throughout the file though, can I have another PR to tidy up the whole file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created issue at #97

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

Are we gonna work on those two points in other PRs then? Are there any other issues here?

@jmuk
Copy link
Contributor

jmuk commented Sep 10, 2014

I think some of #21 are apparent, so you could add this now (and fix the mapping table if we want to modify it).

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

okay will do

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

Alright, got the new error reporting in.

* @return {string} The FSP error code.
*/
var getError = function(code) {
code = '' + code;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

historically, I think you can simply write as:
201: 'OK', 204: 'OK', ...
for Object literals, where each keys are string.
And if you specify a number to the object, it's converted into a string. So you don't have to cast like this here, and you can omit the quote for keys in line 16-24. I believe that's more concise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I usually use the implicit conversion but I was trying to be more rigorous here. It is more concise, though, so I'm happy with that.

@jmuk
Copy link
Contributor

jmuk commented Sep 10, 2014

cool, lgtm.

@jmuk
Copy link
Contributor

jmuk commented Sep 10, 2014

hm, but something prevents the automatic merge. Could you rebase the PR?

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

rebased

@jmuk
Copy link
Contributor

jmuk commented Sep 10, 2014

looks failing

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

Oh it's because I changed the expected error string in the tests for WebDAV. I've updated it to the correct string here, I will fix it more robustly in a future PR that adds proper error handling to S3 like I did for WebDAV

@lavelle
Copy link
Contributor Author

lavelle commented Sep 10, 2014

cool fixed

@jmuk
Copy link
Contributor

jmuk commented Sep 10, 2014

cool

jmuk added a commit that referenced this pull request Sep 10, 2014
Add support for move operation
@jmuk jmuk merged commit 6a2060a into google:master Sep 10, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants