| | |
| | | toAbsolute = function(p) { return PATH.join2(mount.mountpoint, p); }; |
| | | for(var k in data) { |
| | | var f = data[k]; |
| | | var path = f.path; |
| | | if (!path) path = f; |
| | | if (path.indexOf('/') !== -1) { |
| | | |
| | | if (f.path.indexOf('/') !== -1) { |
| | | // we have folders.. stuff them in the list |
| | | var parts = path.split('/'), |
| | | var parts = f.path.split('/'), |
| | | prefix = ''; |
| | | // remove the "file" from the end |
| | | parts.pop(); |
| | |
| | | prefix = p; |
| | | }); |
| | | } |
| | | var p = toAbsolute(path); |
| | | var p = toAbsolute(f.path); |
| | | entries[p] = { |
| | | url: "/" + path, |
| | | path: path.trim('/'), |
| | | url: f.url, |
| | | path: f.path.trim('/'), |
| | | type: 'file', |
| | | timestamp: f.timestamp, |
| | | size: f.size |
| | |
| | | |
| | | // sort paths in ascending order so directory entries are created |
| | | // before the files inside them |
| | | create.forEach(function (path) { |
| | | create.sort().forEach(function (path) { |
| | | var pathinfo = src.entries[path]; |
| | | if (dst.type === 'local') { |
| | | CLOUDFS.loadRemoteEntry(mount, pathinfo, function (err, entry) { |