{ "id": "62410", "key": "TIMOB-1778", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11228", "name": "Release 1.5.0 M03", "archived": true, "released": true, "releaseDate": "2010-11-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:57:08.000+0000", "created": "2011-04-15T03:02:00.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "feature" ], "versions": [], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2011-04-17T01:57:08.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "{html}

See Helpdesk\n42281. Add a method to TiBlob.getFile() that returns the\nunderlying file if it exists. If the TiBlob is not a reference to a\nfile return null.

{html}", "attachment": [], "flagged": false, "summary": "Android: Add Method to TiBlob for Retrieving Underlying File", "creator": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126634", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

From the developer-facing API perspective, the right thing to do\nhere would be to return a FileProxy. However, TiBlob lives in the\ntitanium project (non-module), which to date has no references to\nour modules.

\n

What do you think is the right way to handle this? Return a\nTiFile, which lacks API documentation?

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:00.000+0000", "updated": "2011-04-15T03:02:00.000+0000" }, { "id": "126635", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Maybe we should just documenting returning a path that can be\npassed to the filesystem API to get a file object. Would that\nsuffice?

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:02:00.000+0000", "updated": "2011-04-15T03:02:00.000+0000" }, { "id": "126636", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

.nativePath it is.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126637", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Setting back to \"new\" while not working on it. Still have no\nidea how to get a file path from a content url, and sick of looking\nfor it for now.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126638", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [c5979f87e17694a280d1181d6aafeda399c42d52])\n[#1778 state:open] Give TiBlob a nativePath\nproperty, but still need it to handle content:// urls in such a way\nas to be useful to users wnating to create file proxies with it.\n\nhttps://github.com/appcelerator/titanium_mobile/commit/c5979f87e176...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126639", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [36832a4b1976704db3bc1c37120a6950d157039d])\n[#1778 state:fixed-in-qa] New .nativePath\nproperty will resolve content urls to paths \nhttps://github.com/appcelerator/titanium_mobile/commit/36832a4b1976...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126640", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Bear with me while I make a test case - coming soon

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126641", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

QA: here is an app.js you can use to test this. I'm morphing it\ninto a drillbit test as well, to be committed soon:

\n
\nTitanium.UI.setBackgroundColor('#000');\nvar win = Titanium.UI.createWindow({  \n    title:'Test',\n    backgroundColor:'#fff',\n    exitOnClose: true\n});\nwin.open()\n\nvar console = Ti.UI.createLabel({\n    left:0, right:0, top: 0, height: 400,\n    backgroundColor: 'black', color: 'white',\n    font: {fontSize: 12}, verticalAlign: 'top'\n});\nwin.add(console);\n\nfunction w(s){\n    if (console.text && console.text.length > 0) {\n        console.text = console.text+ '\\n\\n* ' + s;\n    } else {\n        console.text = '* ' + s;\n    }\n}\n\nvar filename = 'blobtest';\nvar testphrase = 'Revenge of the Blob';\n\nw('getting file with path segments ' + Ti.Filesystem.applicationDataDirectory + ', ' + filename);\n\nvar file = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, filename);\n\nif (file.exists()) {\n    w('file exists.  deleting it.');\n    file.deleteFile();\n} else {\n    w('file did not exist -- no need to delete it.');\n}\n\nw('putting text \"' + testphrase + '\" into file');\n\nfile.write(testphrase);\n\nw('getting blob based on file');\n\nvar blob = file.read();\n\nw('destroying original file variable instance to test getting it back via blob');\n\nfile = null;\n\nvar path = blob.nativePath;\n\nw(\"blob says file's path is \" + path);\nw(\"getting new file instance based on that path\");\nfile = Ti.Filesystem.getFile(path);\nif (file.exists()) {\n    w(\"Good - file is said to exist when I get it from that path.\");\n    w(\"Will read contents and see if they match the phrase we put in earlier.\");\n    var readphrase = file.read().text;\n    w('Read this text: \"' + readphrase + '\"');\n    if (testphrase === readphrase) {\n        w('Yay! The phrases match.  TEST SUCCESSFUL');\n    } else {\n        w('FAIL!  The phrases do not match.  Something is wrong.');\n    }\n} else {\n    w(\"FAIL - file is said to not exist.  Something is wrong.\");\n}\n
{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:01.000+0000", "updated": "2011-04-15T03:02:01.000+0000" }, { "id": "126642", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [49374740a28357a89073e187edd5d57a99b0d296])\n[#1778][#2553] Unit test for new blob.nativePath\nproperty \nhttps://github.com/appcelerator/titanium_mobile/commit/49374740a283...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:02.000+0000", "updated": "2011-04-15T03:02:02.000+0000" }, { "id": "126643", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

(from [cad3cbee2789d5bb34454a80e85d81bf451f73c4])\n[#1778][#2553] Unit test for new blob.nativePath\nproperty \nhttps://github.com/appcelerator/titanium_mobile/commit/cad3cbee2789...

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:02:02.000+0000", "updated": "2011-04-15T03:02:02.000+0000" }, { "id": "126644", "author": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

G2 2.2 RC2. Bill you rock

{html}", "updateAuthor": { "name": "thomashuelbert", "key": "thomashuelbert", "displayName": "Thomas Huelbert", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:02:02.000+0000", "updated": "2011-04-15T03:02:02.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }