Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1804110119 for ; Tue, 1 Apr 2014 13:39:44 +0000 (UTC) Received: (qmail 50873 invoked by uid 500); 1 Apr 2014 13:39:41 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 50841 invoked by uid 500); 1 Apr 2014 13:39:41 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 50827 invoked by uid 99); 1 Apr 2014 13:39:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 13:39:39 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of drkemp@google.com designates 209.85.220.179 as permitted sender) Received: from [209.85.220.179] (HELO mail-vc0-f179.google.com) (209.85.220.179) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Apr 2014 13:39:35 +0000 Received: by mail-vc0-f179.google.com with SMTP id ij19so9607865vcb.38 for ; Tue, 01 Apr 2014 06:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=jXfSmhEutOtxP/1iWXTjDglHoUWLCybWtSy3qvzZetg=; b=WMRUD2kZJDDDk0jQC+6ZNNQTFWQgUYm3ZMu2rdkV41y5d/c5JR6dxOUKG7wBJmGZZx BcMbLTx0Im21eA6pNF4gXPLraM2itTNgP3YECAGh0QtNn6O/orqDZXeL/of44HwUSZgF Z4CF0HXInEDv/Pjmm6UXfhIEud0xCJGw03g6dJeoisQk0Yw8VH92uwONHdbyCTWZmLkM cd5NXio+SIyUjTCGIOr1lmJboJgQgYffbslyv4Qxbi2qgfM1z1jQUB2x6JoefnVDxA6R EVhgsxAQDFau4hMcaDgFVlLkHiefmwnAq6AJIIH4rCQSnUwiPbk15aLnyylu3RQ/nyZF N75g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=jXfSmhEutOtxP/1iWXTjDglHoUWLCybWtSy3qvzZetg=; b=PBsL/dWM1dZary2mJxelWTvQhLX1m2KD8613SzxZyN2OP7DwFFcyj68DfiOdwwjdd6 zpAt7+fScJr1H7z+fpKANXrs8NEdqssttk5xWO0NiGPQGyDL4TNmQ8IDnb0ssPpbeMfV qd8F1eS/VcygQLeLjuZoCgjOLLS5Z+Kzp7u0o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=jXfSmhEutOtxP/1iWXTjDglHoUWLCybWtSy3qvzZetg=; b=GAteNnF8mzVVuXoZDWg2YPSJF+nQai5EM9LOJ+EjzPfKhrqtnD/t9gF5jiCmhZwW2I xSpPk612l3MJs1n4qpznCPPcDJEICPZwKKiIeLzle93B5Q1OxCIfsSUene59+S0gCPu4 TNYZKJj1qXuQftucX7PfKDUEMqLQblezXx7p81pIszLzx+002VMZ2V4ps2oOGinVWY20 vUusLDwnDgakE6thwYOQW8X7fS1nb5NoTWgoMiqG6kUsny3KxMw3uxS0q8lEkCmHqdKn Ny82mNo/ZxLGtkCWz0c0ZAxiu5RiMXnl+C48matoGGDgOhKyz6Gnv3cFCHfq9SmjrL6R Doiw== X-Gm-Message-State: ALoCoQnkK/WPirLI5mJB5kGuq37t54BeSl6p28SoQZYMDsUjWlhvYusOtudzPaCgzuLGW1KKTsmpwu+fyQondDlpDtbi1vewFj4Zo3BlqpFR6GN3xfFryjkVf0QvXBVV63t6reOe3ud0ICBc7za72biYkx0FcuZwgUdrC4FKS+vfEwrDqz4hStMHYr2LCFjDei+2e5URWsnhmBWBl9FYIa0GmL7ZlnB9LQ== MIME-Version: 1.0 X-Received: by 10.220.103.141 with SMTP id k13mr1261387vco.25.1396359553821; Tue, 01 Apr 2014 06:39:13 -0700 (PDT) Sender: drkemp@google.com Received: by 10.52.76.167 with HTTP; Tue, 1 Apr 2014 06:39:13 -0700 (PDT) In-Reply-To: References: Date: Tue, 1 Apr 2014 09:39:13 -0400 X-Google-Sender-Auth: CfPg8Zy1L51salE8U1oqWNfqK1Q Message-ID: Subject: Re: Looking at the new File API pragmatically From: David Kemp To: "dev@cordova.apache.org" Content-Type: multipart/alternative; boundary=047d7b342d302f750b04f5fb4b81 X-Virus-Checked: Checked by ClamAV on apache.org --047d7b342d302f750b04f5fb4b81 Content-Type: text/plain; charset=UTF-8 So in summary.... make toURL() return the same thing that toNativeURL() does now. do nothing to toNativeURL() maybe later add a toCdvURL() If thats correct, then +1 On Tue, Apr 1, 2014 at 4:50 AM, Anis KADRI wrote: > On Tue, Apr 1, 2014 at 3:28 AM, Ian Clelland > wrote: > > > On Mon, Mar 31, 2014 at 4:33 PM, Ian Clelland > >wrote: > > > > > On Mon, Mar 31, 2014 at 4:20 PM, Michal Mocny > > wrote: > > > > > >> On Mon, Mar 31, 2014 at 3:39 PM, Ian Clelland > >> >wrote: > > >> > This is ugly, though, and is going to get worse over time, and > become > > a > > >> > division between Cordova and any platforms which actually implement > > the > > >> > File API correctly. I'd like to propose switching the behaviour of > > >> > .toURL(), to match .toNativeURL -- returning a webview-usable URL by > > >> > default -- and implementing some other method or property to get the > > CDV > > >> > URL when it's necessary. > > >> > > > >> > > >> Everything you've said sounds like its all upside to make the switch. > > So > > >> I'm curious, when would CDV URL be necessary/useful over file/content > > >> urls? > > >> > > > > > > cdvfile:// URLs would still be necessary when dealing with files that > > just > > > don't *have* an alternate representation. There currently aren't any of > > > those, but we could implement virtual file systems entirely inside of a > > > plugin, and those would require a cdvfile:// URL to be read. > > > > > > I think we'd recommend them when saving URLs to persistent storage, if > > > there is any chance that the actual files could be moved / migrated, > and > > we > > > could hide that from the user by giving them a more abstract identifier > > > than one which specifies a physical location. > > > cdvfile://localhost/persistent/my/file.txt might be more durable over > > time > > > than file:///data/data/com.company.package/files/my/file.txt, perhaps > > > across OS upgrades. > > > > > > > Actually, forget all of that. > > > > Your question had me looking for reasons to advocate users using > cdvfile:// > > URLs, when perhaps none exist. The truth of the matter is this: The > cdvfile > > URL has two parts: the filesystem name, and the full path. Those two > parts > > form a consistent internal representation for all of the types of file > that > > the plugin can handle, and so all of the internal / native bits of the > file > > plugin use them almost exclusively. We make sure that every FileEntry and > > DirectoryEntry has those parts, and we only need to turn them into a URL > > for passing them across the bridge. > > > > One day someone may discover a great reason to use deliberately use > cdvfile > > URLs at the application level; until then, they're available, and we can > > continue to use them internally to simplify the plugin code, enforce the > > sandboxing, and make everything generally more consistent and efficient, > > and users shouldn't need to know or care what the URLs in use actually > are. > > > > I agree with this as long as the URLs are useable in the WebView (as src > attributes for example). If they're not, I also suggest that we return URLs > that are useable (file:///, content:/// or whatever) by default. > > As for filesystems (temp or persistent), I think most developers will use > whatever the default is. BUT they should be able to specify where they want > to store their data if they feel like it without using a third-party > plugin. > > > > > > Ian > > > --047d7b342d302f750b04f5fb4b81--