{ "id": "80230", "key": "TIMOB-5274", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-09-12T13:23:55.000+0000", "created": "2011-09-12T12:40:15.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "11971", "description": "iOS5 and select Android fixes", "name": "Release 1.7.3", "archived": true, "released": true, "releaseDate": "2011-10-18" } ], "issuelinks": [], "assignee": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:41:21.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": "In iOS you can copy a folder and all of its contents with the example below. \r\nAndroid throws a null pointer exception.\r\n\r\nRequesting the ability to copy a folder and all its contents for parity with iOS.\r\n\r\nStep 1: create a folder named \"data\" in your resources directory and make some files in it.\r\nStep 2: run the code below\r\nStep 3: click the \"Copy Folder button\r\nStep 4: notice the null pointer exception\r\n(This should copy the folder with contents and print the contents of the folder to the log)\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ \r\n\tbackgroundColor: '#fff',\r\n\tlayout: 'vertical'\r\n});\r\n\r\nvar testButton = Ti.UI.createButton({\r\n\ttitle: \"Copy Folder\",\r\n\ttop: 20,\r\n\theight: 50,\r\n\twidth: 250,\r\n});\r\ntestButton.addEventListener('click', function(e){\r\n\t// this will copy the data folder and its contents\r\n\tvar srcDataDir = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, \"data\");\r\n \tvar destDataDir = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, \"data\");\r\n \tdestDataDir.write(srcDataDir.read());\r\n \tTi.API.info(\"listing: \" + destDataDir.getDirectoryListing());\r\n});\r\n\r\nwin.add(testButton);\r\nwin.open();\r\n{code}\r\n\r\nh4. Associated Helpdesk Ticket\r\nhttp://appc.me/c/APP-728922", "attachment": [], "flagged": false, "summary": "Android: copy folder with contents ", "creator": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "TiSDK 1.7.3.v20110826161351\r\nAndroid Emulator 2.2", "comment": { "comments": [ { "id": "165685", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is not the correct way to copy a folder with contents.\nThe correct way is to walk the tree and copy each file individually.", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-12T13:23:55.000+0000", "updated": "2011-09-12T13:23:55.000+0000" }, { "id": "411103", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:41:21.000+0000", "updated": "2017-03-09T23:41:21.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }