{ "id": "64156", "key": "TIMOB-3524", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-05-02T21:47:41.000+0000", "created": "2011-04-15T03:46:16.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "defect" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-05-02T21:47:41.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}

Environment:

\n\n

Although the createFile() method is documented in\n\nTitanium.Filesystem.File, no code exists for it in the Titanium\nAndroid SDK source, at \nTiBaseFile.java. Furthermore, no demonstration of its usage\nexists in \nfilesystem.js.

\n

The workaround is to use the write() method\ninstead, but unless a string is passed to it (even and empty one\nlike write(\"\") ) then the file is not created.

\n

The following code demonstrates the issue:

\n
\nvar newDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory,'html');\nTi.API.info(\"newDir.nativePath = \" + newDir.nativePath);\n\nnewDir.createDirectory();\n\nvar fileTest = Ti.Filesystem.getFile(newDir.nativePath,'test.html');\nfileTest.deleteFile();\nTi.API.info(\"test.html exists before write()? \" + fileTest.exists());\nfileTest.write();\nTi.API.info(\"test.html exists after write()? \" + fileTest.exists());\nfileTest.write('');\nTi.API.info(\"test.html exists after write('')? \" + fileTest.exists());\n
\n

Proposed solution:

\n\n

Note that depending on the chosen solution, obviously the tags\nused in this ticket may be incorrect, and another ticket may need\nto raised.

{html}", "attachment": [], "flagged": false, "summary": "Android: Ti.Filesystem.File.createFile() does not exist", "creator": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [ { "id": "418874", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-05-02T21:47:41.000+0000", "updated": "2017-05-02T21:47:41.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }