[TIMOB-1778] Android: Add Method to TiBlob for Retrieving Underlying File
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:57:08.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.5.0 M03 |
Components | Android |
Labels | android, feature |
Reporter | Don Thorp |
Assignee | Bill Dawson |
Created | 2011-04-15T03:02:00.000+0000 |
Updated | 2011-04-17T01:57:08.000+0000 |
Description
See http://developer.appcelerator.com/helpdesk/view/42281">Helpdesk
42281. Add a method to TiBlob.getFile() that returns the
underlying file if it exists. If the TiBlob is not a reference to a
file return null
.
From the developer-facing API perspective, the right thing to do here would be to return a FileProxy. However, TiBlob lives in the titanium project (non-module), which to date has no references to our modules.
What do you think is the right way to handle this? Return a TiFile, which lacks API documentation?
Maybe we should just documenting returning a path that can be passed to the filesystem API to get a file object. Would that suffice?
.nativePath it is.
Setting back to "new" while not working on it. Still have no idea how to get a file path from a content url, and sick of looking for it for now.
(from [c5979f87e17694a280d1181d6aafeda399c42d52]) [#1778 state:open] Give TiBlob a nativePath property, but still need it to handle content:// urls in such a way as to be useful to users wnating to create file proxies with it. https://github.com/appcelerator/titanium_mobile/commit/c5979f87e17694a280d1181d6aafeda399c42d52"> https://github.com/appcelerator/titanium_mobile/commit/c5979f87e176...
(from [36832a4b1976704db3bc1c37120a6950d157039d]) [#1778 state:fixed-in-qa] New .nativePath property will resolve content urls to paths https://github.com/appcelerator/titanium_mobile/commit/36832a4b1976704db3bc1c37120a6950d157039d"> https://github.com/appcelerator/titanium_mobile/commit/36832a4b1976...
Bear with me while I make a test case - coming soon
QA: here is an app.js you can use to test this. I'm morphing it into a drillbit test as well, to be committed soon:
(from [49374740a28357a89073e187edd5d57a99b0d296]) [#1778][#2553] Unit test for new blob.nativePath property https://github.com/appcelerator/titanium_mobile/commit/49374740a28357a89073e187edd5d57a99b0d296"> https://github.com/appcelerator/titanium_mobile/commit/49374740a283...
(from [cad3cbee2789d5bb34454a80e85d81bf451f73c4]) [#1778][#2553] Unit test for new blob.nativePath property https://github.com/appcelerator/titanium_mobile/commit/cad3cbee2789d5bb34454a80e85d81bf451f73c4"> https://github.com/appcelerator/titanium_mobile/commit/cad3cbee2789...
G2 2.2 RC2. Bill you rock