{ "id": "110412", "key": "TIMOB-12901", "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": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15397", "description": "2013 Soprint 07 API", "name": "2013 Sprint 07 API", "archived": true, "released": true, "releaseDate": "2013-04-08" }, { "id": "15105", "description": "2013 Sprint 07", "name": "2013 Sprint 07", "archived": true, "released": true, "releaseDate": "2013-04-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-27T18:14:07.000+0000", "created": "2013-03-01T00:31:54.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "filesystem", "qe-sdk3.1.0", "qe-testadded" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "26340", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "108502", "key": "TIMOB-12414", "fields": { "summary": "iOS: Add isFile method to Ti.FileSystemProxy for parity with Android", "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" } }, "priority": { "name": "Trivial", "id": "5" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-03-27T18:14:07.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": "While testing New iOS feature for parity with Android I noticed that resources \"Directory\" is interpreted as a \"File\" on Android.\r\n\r\nTest steps:\r\n1.Run the following code\r\n{code}\r\n/*jslint maxerr:1000 */\r\n \r\n//Test if the resources folder is a directory.\r\nvar resourceDir = Titanium.Filesystem.getFile(Titanium.Filesystem.resourcesDirectory);\r\nTi.API.info('resourceDir ' + resourceDir);\r\nTi.API.info('resourceDir nativePath ' + resourceDir.nativePath);\r\nTi.API.info('resourceDir isDirectory ' + resourceDir.isDirectory());\r\nTi.API.info('resourceDir isFile ' + resourceDir.isFile());\r\n \r\n \r\nvar newDir = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory,'mydir');\r\nif(!newDir.exists()){\r\n Ti.API.info(\"Created mydir: \" + newDir.createDirectory()); \r\n}\r\n \r\nvar newFile = Titanium.Filesystem.getFile(newDir.nativePath,'newfile.txt');\r\nnewFile.write(\"\\nText appended via write()\", true);\r\n \r\nTi.API.info('newdir ' + newDir);\r\nTi.API.info('newdir nativePath ' + newDir.nativePath);\r\nTi.API.info('newdir isDirectory ' + newDir.isDirectory());\r\nTi.API.info('newdir isFile ' + newDir.isFile());\r\n \r\n \r\nTi.API.info('newFile ' + newFile);\r\nTi.API.info('newFile nativePath ' + newFile.nativePath);\r\nTi.API.info('newFile isDirectory ' + newFile.isDirectory());\r\nTi.API.info('newFile isFile ' + newFile.isFile());\r\n\r\nTi.API.info('End Test');\r\n\r\nTi.API.info('Now open a window so we can test on device easier');\r\n \r\n// Create a simple window to show our results\r\n(function(){\r\n\t\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tbackgroundColor:'#fff',layout:'vertical'\r\n\t});\r\n \r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'resourceDir isDirectory ' + resourceDir.isDirectory()\r\n\t}));\r\n\t\r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'resourceDir isFile ' + resourceDir.isFile()\r\n\t}));\r\n\t\t\r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'newdir isDirectory ' + newDir.isDirectory()\r\n\t}));\r\n\t\r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'newdir isFile ' + newDir.isFile()\r\n\t}));\r\n \r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'newFile isDirectory ' + newFile.isDirectory()\r\n\t}));\r\n\t\r\n\twin.add(Ti.UI.createLabel({\r\n\t\ttop:10, text:'newFile isFile ' + newFile.isFile()\r\n\t}));\r\n \r\n\t\t\t\t\t\r\n\twin.open();\t\r\n\t\r\n})();\r\n \r\n{code}\r\n\r\nActual result:\r\nAndroid - resourceDir isFile true\r\niOS - resourceDir isFile false\r\n\r\nExpected:\r\nresourceDir isFile false", "attachment": [ { "id": "35830", "filename": "Android.png", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-01T00:31:54.000+0000", "size": 31681, "mimeType": "image/png" }, { "id": "35831", "filename": "iPhone.png", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-01T00:31:54.000+0000", "size": 50385, "mimeType": "image/png" }, { "id": "35832", "filename": "logcat.txt", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-01T00:31:54.000+0000", "size": 784, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Ti.FileSystemProxy interprets resourceDir as a File", "creator": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium Studio, build: 3.0.2.201302191606\r\nTitanium SDK, build: 3.1.0.v20130228124855\r\nDevices:\r\nNexus4 Android version 4.2\r\niPhone5 6.0", "comment": { "comments": [ { "id": "244067", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/4032", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-26T01:25:46.000+0000", "updated": "2013-03-26T01:25:46.000+0000" }, { "id": "244336", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested and verified fix with:\r\nTitanium Studio, build: 3.1.0.201303261815\r\nTitanium SDK, build: 3.1.0.v20130327075056\r\nDevice:\r\nNexus7 Android version 4.2", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-27T18:08:57.000+0000", "updated": "2013-03-27T18:13:57.000+0000" }, { "id": "244340", "author": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "body": "reopened to correct comment", "updateAuthor": { "name": "oromero", "key": "oromero", "displayName": "Olga Romero", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-27T18:13:27.000+0000", "updated": "2013-03-27T18:13:27.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }