{"action":"created","comment":{"url":"https://api.github.com/repos/owncloud/android/pulls/comments/47444786","id":47444786,"diff_hunk":"@@ -0,0 +1,107 @@\n+/**\n+ *   ownCloud Android client application\n+ *\n+ *   @author Bartek Przybylski\n+ *   Copyright (C) 2015  Bartosz Przybylski\n+ *   Copyright (C) 2015 ownCloud Inc.\n+ *\n+ *   This program is free software: you can redistribute it and/or modify\n+ *   it under the terms of the GNU General Public License version 2,\n+ *   as published by the Free Software Foundation.\n+ *\n+ *   This program is distributed in the hope that it will be useful,\n+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+ *   GNU General Public License for more details.\n+ *\n+ *   You should have received a copy of the GNU General Public License\n+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+ *\n+ */\n+\n+package com.owncloud.android.utils;\n+\n+import android.content.Context;\n+import android.os.Build;\n+import android.os.Environment;\n+\n+import com.owncloud.android.R;\n+\n+import java.io.File;\n+import java.util.ArrayList;\n+import java.util.List;\n+\n+/**\n+ * @author Bartosz Przybylski\n+ */\n+public class DataStorageUtils {\n+\tstatic public final class Storage {\n+\t\tprivate String mDescription;\n+\t\tprivate String mPath;\n+\n+\t\tStorage(String description, String path) {\n+\t\t\tmDescription = description;\n+\t\t\tmPath = path;\n+\t\t}\n+\n+\t\tpublic String getPath() { return mPath; }\n+\t\tpublic String getDescription() { return mDescription; }\n+\t}\n+\n+\tstatic public Storage[] getAvailableStoragePoints(Context context) {\n+\t\t// Android 6.0 and later changed some internal implementation of accessing storage\n+\t\t// so for now we return only single path named \"external\"\n+\t\t// TODO(przybylski): add 6.0 code\n+\t\tif (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP_MR1) {\n+\t\t\treturn new Storage[] {\n+\t\t\t\tnew Storage(context.getString(R.string.storage_description_external),\n+\t\t\t\t\t\t    Environment.getExternalStorageDirectory().getAbsolutePath())\n+\t\t\t};\n+\t\t}\n+\n+\t\tList<Storage> list = new ArrayList<>();\n+\n+\t\tString storagePath = Environment.getExternalStorageDirectory().getPath();\n+\t\tif (canBeAddedToAvailableList(storagePath))\n+\t\t\tlist.add(new Storage(context.getString(R.string.storage_description_external),\n+\t\t\t\t\t \t\t\t storagePath));\n+\n+\t\tstoragePath = System.getenv(\"SECONDARY_STORAGE\"); // : separated paths to sd cards\n+\t\tlist.addAll(getSDCardStorage(storagePath, context));\n+\n+\t\tlist.add(new Storage(\"Costam\", Environment.getExternalStorageDirectory().getAbsolutePath() + \"/costam\"));","path":"src/com/owncloud/android/utils/DataStorageUtils.java","position":72,"original_position":72,"commit_id":"fa893f896b5e1710dbe316b02e30d5471cda2f05","original_commit_id":"fa893f896b5e1710dbe316b02e30d5471cda2f05","user":{"login":"przybylski","id":1734309,"avatar_url":"https://avatars.githubusercontent.com/u/1734309?v=3","gravatar_id":"","url":"https://api.github.com/users/przybylski","html_url":"https://github.com/przybylski","followers_url":"https://api.github.com/users/przybylski/followers","following_url":"https://api.github.com/users/przybylski/following{/other_user}","gists_url":"https://api.github.com/users/przybylski/gists{/gist_id}","starred_url":"https://api.github.com/users/przybylski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/przybylski/subscriptions","organizations_url":"https://api.github.com/users/przybylski/orgs","repos_url":"https://api.github.com/users/przybylski/repos","events_url":"https://api.github.com/users/przybylski/events{/privacy}","received_events_url":"https://api.github.com/users/przybylski/received_events","type":"User","site_admin":false},"body":"It was a testing entry, 'cośtam' means 'something' in polish, I forgot to remove it :)\r\n","created_at":"2015-12-13T14:08:06Z","updated_at":"2015-12-13T14:08:06Z","html_url":"https://github.com/owncloud/android/pull/1293#discussion_r47444786","pull_request_url":"https://api.github.com/repos/owncloud/android/pulls/1293","_links":{"self":{"href":"https://api.github.com/repos/owncloud/android/pulls/comments/47444786"},"html":{"href":"https://github.com/owncloud/android/pull/1293#discussion_r47444786"},"pull_request":{"href":"https://api.github.com/repos/owncloud/android/pulls/1293"}}},"pull_request":{"url":"https://api.github.com/repos/owncloud/android/pulls/1293","id":51222383,"html_url":"https://github.com/owncloud/android/pull/1293","diff_url":"https://github.com/owncloud/android/pull/1293.diff","patch_url":"https://github.com/owncloud/android/pull/1293.patch","issue_url":"https://api.github.com/repos/owncloud/android/issues/1293","number":1293,"state":"open","locked":false,"title":"External SD2","user":{"login":"przybylski","id":1734309,"avatar_url":"https://avatars.githubusercontent.com/u/1734309?v=3","gravatar_id":"","url":"https://api.github.com/users/przybylski","html_url":"https://github.com/przybylski","followers_url":"https://api.github.com/users/przybylski/followers","following_url":"https://api.github.com/users/przybylski/following{/other_user}","gists_url":"https://api.github.com/users/przybylski/gists{/gist_id}","starred_url":"https://api.github.com/users/przybylski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/przybylski/subscriptions","organizations_url":"https://api.github.com/users/przybylski/orgs","repos_url":"https://api.github.com/users/przybylski/repos","events_url":"https://api.github.com/users/przybylski/events{/privacy}","received_events_url":"https://api.github.com/users/przybylski/received_events","type":"User","site_admin":false},"body":"Implement mechanism with @tobiasKaminsky to allow users to specify their owncloud storage path.\r\nTogether with migration mechanism.\r\nhttps://github.com/owncloud/android/issues/10","created_at":"2015-11-19T13:33:38Z","updated_at":"2015-12-13T14:08:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bde9679a4ee37b030d626f2a451b6945ef15aaed","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/owncloud/android/pulls/1293/commits","review_comments_url":"https://api.github.com/repos/owncloud/android/pulls/1293/comments","review_comment_url":"https://api.github.com/repos/owncloud/android/pulls/comments{/number}","comments_url":"https://api.github.com/repos/owncloud/android/issues/1293/comments","statuses_url":"https://api.github.com/repos/owncloud/android/statuses/fa893f896b5e1710dbe316b02e30d5471cda2f05","head":{"label":"owncloud:externalSD2","ref":"externalSD2","sha":"fa893f896b5e1710dbe316b02e30d5471cda2f05","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550567,"name":"android","full_name":"owncloud/android","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/android","description":"The ownCloud Android App","fork":false,"url":"https://api.github.com/repos/owncloud/android","forks_url":"https://api.github.com/repos/owncloud/android/forks","keys_url":"https://api.github.com/repos/owncloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/android/teams","hooks_url":"https://api.github.com/repos/owncloud/android/hooks","issue_events_url":"https://api.github.com/repos/owncloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/android/events","assignees_url":"https://api.github.com/repos/owncloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/android/tags","blobs_url":"https://api.github.com/repos/owncloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/android/languages","stargazers_url":"https://api.github.com/repos/owncloud/android/stargazers","contributors_url":"https://api.github.com/repos/owncloud/android/contributors","subscribers_url":"https://api.github.com/repos/owncloud/android/subscribers","subscription_url":"https://api.github.com/repos/owncloud/android/subscription","commits_url":"https://api.github.com/repos/owncloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/android/merges","archive_url":"https://api.github.com/repos/owncloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/android/downloads","issues_url":"https://api.github.com/repos/owncloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/android/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/android/releases{/id}","created_at":"2012-08-25T10:35:56Z","updated_at":"2015-12-11T08:25:46Z","pushed_at":"2015-12-13T13:42:50Z","git_url":"git://github.com/owncloud/android.git","ssh_url":"git@github.com:owncloud/android.git","clone_url":"https://github.com/owncloud/android.git","svn_url":"https://github.com/owncloud/android","homepage":null,"size":102653,"stargazers_count":1240,"watchers_count":1240,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1372,"mirror_url":null,"open_issues_count":330,"forks":1372,"open_issues":330,"watchers":1240,"default_branch":"master"}},"base":{"label":"owncloud:master","ref":"master","sha":"05232de750fb5e9de802e9963c9db55b6fd0fe08","user":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"repo":{"id":5550567,"name":"android","full_name":"owncloud/android","owner":{"login":"owncloud","id":1645051,"avatar_url":"https://avatars.githubusercontent.com/u/1645051?v=3","gravatar_id":"","url":"https://api.github.com/users/owncloud","html_url":"https://github.com/owncloud","followers_url":"https://api.github.com/users/owncloud/followers","following_url":"https://api.github.com/users/owncloud/following{/other_user}","gists_url":"https://api.github.com/users/owncloud/gists{/gist_id}","starred_url":"https://api.github.com/users/owncloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owncloud/subscriptions","organizations_url":"https://api.github.com/users/owncloud/orgs","repos_url":"https://api.github.com/users/owncloud/repos","events_url":"https://api.github.com/users/owncloud/events{/privacy}","received_events_url":"https://api.github.com/users/owncloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/owncloud/android","description":"The ownCloud Android App","fork":false,"url":"https://api.github.com/repos/owncloud/android","forks_url":"https://api.github.com/repos/owncloud/android/forks","keys_url":"https://api.github.com/repos/owncloud/android/keys{/key_id}","collaborators_url":"https://api.github.com/repos/owncloud/android/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/owncloud/android/teams","hooks_url":"https://api.github.com/repos/owncloud/android/hooks","issue_events_url":"https://api.github.com/repos/owncloud/android/issues/events{/number}","events_url":"https://api.github.com/repos/owncloud/android/events","assignees_url":"https://api.github.com/repos/owncloud/android/assignees{/user}","branches_url":"https://api.github.com/repos/owncloud/android/branches{/branch}","tags_url":"https://api.github.com/repos/owncloud/android/tags","blobs_url":"https://api.github.com/repos/owncloud/android/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/owncloud/android/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/owncloud/android/git/refs{/sha}","trees_url":"https://api.github.com/repos/owncloud/android/git/trees{/sha}","statuses_url":"https://api.github.com/repos/owncloud/android/statuses/{sha}","languages_url":"https://api.github.com/repos/owncloud/android/languages","stargazers_url":"https://api.github.com/repos/owncloud/android/stargazers","contributors_url":"https://api.github.com/repos/owncloud/android/contributors","subscribers_url":"https://api.github.com/repos/owncloud/android/subscribers","subscription_url":"https://api.github.com/repos/owncloud/android/subscription","commits_url":"https://api.github.com/repos/owncloud/android/commits{/sha}","git_commits_url":"https://api.github.com/repos/owncloud/android/git/commits{/sha}","comments_url":"https://api.github.com/repos/owncloud/android/comments{/number}","issue_comment_url":"https://api.github.com/repos/owncloud/android/issues/comments{/number}","contents_url":"https://api.github.com/repos/owncloud/android/contents/{+path}","compare_url":"https://api.github.com/repos/owncloud/android/compare/{base}...{head}","merges_url":"https://api.github.com/repos/owncloud/android/merges","archive_url":"https://api.github.com/repos/owncloud/android/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/owncloud/android/downloads","issues_url":"https://api.github.com/repos/owncloud/android/issues{/number}","pulls_url":"https://api.github.com/repos/owncloud/android/pulls{/number}","milestones_url":"https://api.github.com/repos/owncloud/android/milestones{/number}","notifications_url":"https://api.github.com/repos/owncloud/android/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/owncloud/android/labels{/name}","releases_url":"https://api.github.com/repos/owncloud/android/releases{/id}","created_at":"2012-08-25T10:35:56Z","updated_at":"2015-12-11T08:25:46Z","pushed_at":"2015-12-13T13:42:50Z","git_url":"git://github.com/owncloud/android.git","ssh_url":"git@github.com:owncloud/android.git","clone_url":"https://github.com/owncloud/android.git","svn_url":"https://github.com/owncloud/android","homepage":null,"size":102653,"stargazers_count":1240,"watchers_count":1240,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1372,"mirror_url":null,"open_issues_count":330,"forks":1372,"open_issues":330,"watchers":1240,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/owncloud/android/pulls/1293"},"html":{"href":"https://github.com/owncloud/android/pull/1293"},"issue":{"href":"https://api.github.com/repos/owncloud/android/issues/1293"},"comments":{"href":"https://api.github.com/repos/owncloud/android/issues/1293/comments"},"review_comments":{"href":"https://api.github.com/repos/owncloud/android/pulls/1293/comments"},"review_comment":{"href":"https://api.github.com/repos/owncloud/android/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/owncloud/android/pulls/1293/commits"},"statuses":{"href":"https://api.github.com/repos/owncloud/android/statuses/fa893f896b5e1710dbe316b02e30d5471cda2f05"}}}}