| | |
| | | return false; |
| | | } |
| | | }, |
| | | populateDirs: function(entries, f, toAbsolute) { |
| | | if (f.path.indexOf('/') !== -1) { |
| | | // we have folders.. stuff them in the list |
| | | var parts = f.path.split('/'), |
| | | prefix = ''; |
| | | // remove the "file" from the end |
| | | parts.pop(); |
| | | // remove the empty directory from the beginning |
| | | if (parts[0] == '') parts.shift(); |
| | | |
| | | parts.forEach(function(e) { |
| | | var p = prefix.length ? PATH.join2(prefix, e) : e, |
| | | abs = toAbsolute(p); |
| | | if (!(abs in entries)) { |
| | | entries[abs] = { |
| | | path: p, |
| | | type: 'dir', |
| | | timestamp: f.timestamp |
| | | }; |
| | | } |
| | | prefix = p; |
| | | }); |
| | | } |
| | | }, |
| | | // Getting list of entities |
| | | getLocalSet: function(mount, callback) { |
| | | function isRealDir(p) { |
| | |
| | | for(var k in data) { |
| | | var f = data[k]; |
| | | |
| | | if (f.path.indexOf('/') !== -1) { |
| | | // we have folders.. stuff them in the list |
| | | var parts = f.path.split('/'), |
| | | prefix = ''; |
| | | // remove the "file" from the end |
| | | parts.pop(); |
| | | // remove the empty directory from the beginning |
| | | if (parts[0] == '') parts.shift(); |
| | | CLOUDFS.populateDirs(entries, f, toAbsolute); |
| | | |
| | | parts.forEach(function(e) { |
| | | var p = prefix.length ? PATH.join2(prefix, e) : e, |
| | | abs = toAbsolute(p); |
| | | if (!(abs in entries)) { |
| | | entries[abs] = { |
| | | path: p, |
| | | type: 'dir', |
| | | timestamp: f.timestamp |
| | | }; |
| | | } |
| | | prefix = p; |
| | | }); |
| | | } |
| | | var p = toAbsolute(f.path); |
| | | entries[p] = { |
| | | url: f.url, |