[ 
https://issues.apache.org/jira/browse/CB-6571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14037286#comment-14037286
 ] 

Andrew Grieve commented on CB-6571:
-----------------------------------

Good idea. Probably constructor is better. 

Just re-tested and looks like my first browser test was too simple (only tested 
root.toURL()). Here's a better test:

{code}
webkitRequestFileSystem(TEMPORARY, 10000, function(f) {fs = f})
undefined
fs.root.toURL()
"filesystem:https://issues.apache.org/temporary/";
fs.root.fullPath
"/"
fs.root.getDirectory('hi', {create:true}, function(e) { ent = e })
undefined
ent.fullPath
"/hi"
ent.toURL()
"filesystem:https://issues.apache.org/temporary/hi";
{code}


So:
* fs.root has trailing /
* subdirectories do not
* paths do not, except for root

filesystem: URLs more reflect cdvfile: urls though, not really file: urls. And 
since the root is different from subdirectories, apps would need to always 
check for trailing slashes themselves anyways when given a URL (ugh). So... 
Maybe let's not try and match this behaviour and try to be consistent ourselves 
at least.

[~iclelland] any thoughts on this?

> DirectoryEntry.toURL() has a trailing slash on iOS but not Android
> ------------------------------------------------------------------
>
>                 Key: CB-6571
>                 URL: https://issues.apache.org/jira/browse/CB-6571
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>            Priority: Minor
>
> We should be consistent with this and always have directories end with at /.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to