| 268 | // Path can be relative or absolute. If relative, it's taken from the cwd_. |
| 269 | // If a filesystem URL is passed it, it is simple returned |
| 270 | var pathToFsURL_ = function(path) { |
| 271 | if (!isFsURL_(path)) { |
| 272 | if (path[0] == '/') { |
| 273 | path = fs_.root.toURL() + path.substring(1); |
| 274 | } else if (path.indexOf('./') == 0 || path.indexOf('../') == 0) { |
| 275 | if (path == '../' && cwd_ != fs_.root) { |
| 276 | path = cwd_.toURL() + '/' + path; |
| 277 | } else { |
| 278 | path = cwd_.toURL() + path; |
| 279 | } |
| 280 | } else { |
| 281 | path = cwd_.toURL() + '/' + path; |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | return path; |
| 286 | }; |
| 287 | |
| 288 | /** |
| 289 | * Looks up a FileEntry or DirectoryEntry for a given path. |