{"action":"created","issue":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/4074","repository_url":"https://api.github.com/repos/libgdx/libgdx","labels_url":"https://api.github.com/repos/libgdx/libgdx/issues/4074/labels{/name}","comments_url":"https://api.github.com/repos/libgdx/libgdx/issues/4074/comments","events_url":"https://api.github.com/repos/libgdx/libgdx/issues/4074/events","html_url":"https://github.com/libgdx/libgdx/issues/4074","id":153829178,"number":4074,"title":"Unable to copy internal directory from desktop jar","user":{"login":"SonarBeserk","id":1880661,"avatar_url":"https://avatars.githubusercontent.com/u/1880661?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarBeserk","html_url":"https://github.com/SonarBeserk","followers_url":"https://api.github.com/users/SonarBeserk/followers","following_url":"https://api.github.com/users/SonarBeserk/following{/other_user}","gists_url":"https://api.github.com/users/SonarBeserk/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarBeserk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarBeserk/subscriptions","organizations_url":"https://api.github.com/users/SonarBeserk/orgs","repos_url":"https://api.github.com/users/SonarBeserk/repos","events_url":"https://api.github.com/users/SonarBeserk/events{/privacy}","received_events_url":"https://api.github.com/users/SonarBeserk/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-09T17:36:59Z","updated_at":"2016-05-11T16:32:02Z","closed_at":"2016-05-11T16:32:02Z","body":"Please ensure you have given all the following requested information in your report.\r\n\r\n#### Issue details\r\nI am working on the desktop version and attempting to copy an internal directory named default to be a local directory named \"addons/default\". However it fails to copy and throws an exception. This code is being run with the dist jar for desktop.\r\n\r\n#### Reproduction steps/code\r\n1. Create directory in assets named default, add some sub dirs\r\n2. Add following code\r\n``` java\r\n        FileHandle addonsLocalDir = Gdx.files.local(\"addons\");\r\n        if(!addonsLocalDir.exists()) {\r\n            addonsLocalDir.mkdirs();\r\n            FileHandle addons = Gdx.files.internal(\"default\");\r\n            System.out.println(\"exists: \" + addons.exists());\r\n            System.out.println(\"name:  \" + addons.name());\r\n            System.out.println(\"isDir: \" + addons.isDirectory());\r\n            addons.copyTo(addonsLocalDir);\r\n        }\r\n```\r\n3. Package code using desktop dist\r\n4. Run Game\r\n\r\n#### Version of LibGDX and/or relevant dependencies\r\nlibgdx: 1.9.2\r\nVersion: Desktop\r\n\r\n#### Stacktrace\r\n```java\r\nexists: true\r\nname:  default\r\nisDir: false\r\nException in thread \"LWJGL Application\" com.badlogic.gdx.utils.GdxRuntimeException: Error copying source file: default (Internal)\r\nTo destination: addons\\default (Local)\r\n        at com.badlogic.gdx.files.FileHandle.copyFile(FileHandle.java:684)\r\n        at com.badlogic.gdx.files.FileHandle.copyTo(FileHandle.java:574)\r\n        at net.mountainblade.hexcard.Addon.reloadAll(Addon.java:53)\r\n        at net.mountainblade.hexcard.HexCardGame.create(HexCardGame.java:36)\r\n        at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:147)\r\n        at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:124)\r\nCaused by: com.badlogic.gdx.utils.GdxRuntimeException: Error stream writing to file: addons\\default (Local)\r\n        at com.badlogic.gdx.files.FileHandle.write(FileHandle.java:296)\r\n        at com.badlogic.gdx.files.FileHandle.copyFile(FileHandle.java:682)\r\n        ... 5 more\r\nCaused by: java.lang.NullPointerException\r\n        at java.io.FilterInputStream.read(Unknown Source)\r\n        at java.io.FilterInputStream.read(Unknown Source)\r\n        at com.badlogic.gdx.utils.StreamUtils.copyStream(StreamUtils.java:49)\r\n        at com.badlogic.gdx.utils.StreamUtils.copyStream(StreamUtils.java:36)\r\n        at com.badlogic.gdx.files.FileHandle.write(FileHandle.java:294)\r\n        ... 6 more\r\n\r\n```\r\n\r\n#### Please select the affected platforms\r\n- [ ] Android\r\n- [ ] iOS\r\n- [ ] HTML/GWT\r\n- [x] Windows\r\n- [ ] Linux\r\n- [ ] MacOS\r\n"},"comment":{"url":"https://api.github.com/repos/libgdx/libgdx/issues/comments/218514812","html_url":"https://github.com/libgdx/libgdx/issues/4074#issuecomment-218514812","issue_url":"https://api.github.com/repos/libgdx/libgdx/issues/4074","id":218514812,"user":{"login":"SonarBeserk","id":1880661,"avatar_url":"https://avatars.githubusercontent.com/u/1880661?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarBeserk","html_url":"https://github.com/SonarBeserk","followers_url":"https://api.github.com/users/SonarBeserk/followers","following_url":"https://api.github.com/users/SonarBeserk/following{/other_user}","gists_url":"https://api.github.com/users/SonarBeserk/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarBeserk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarBeserk/subscriptions","organizations_url":"https://api.github.com/users/SonarBeserk/orgs","repos_url":"https://api.github.com/users/SonarBeserk/repos","events_url":"https://api.github.com/users/SonarBeserk/events{/privacy}","received_events_url":"https://api.github.com/users/SonarBeserk/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T16:32:02Z","updated_at":"2016-05-11T16:32:02Z","body":"I ended up just settling for manually choosing the files to load. Adding a zip wasn't very feasible for me."}}