{"action":"created","comment":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/33457100","id":33457100,"diff_hunk":"@@ -0,0 +1,149 @@\n+/*******************************************************************************\n+ * Copyright (c) 2013 Red Hat, Inc.\n+ * Distributed under license by Red Hat, Inc. All rights reserved.\n+ * This program is made available under the terms of the\n+ * Eclipse Public License v1.0 which accompanies this distribution,\n+ * and is available at http://www.eclipse.org/legal/epl-v10.html\n+ *\n+ * Contributors:\n+ *     Red Hat, Inc. - initial API and implementation\n+ ******************************************************************************/\n+package org.jboss.tools.openshift.internal.ui.preferences;\n+\n+import java.io.File;\n+import java.io.IOException;\n+import java.util.Collection;\n+import java.util.concurrent.TimeUnit;\n+\n+import org.apache.commons.io.FileUtils;\n+import org.apache.commons.io.IOUtils;\n+import org.apache.commons.io.filefilter.IOFileFilter;\n+import org.apache.commons.lang.StringUtils;\n+import org.apache.commons.lang.SystemUtils;\n+import org.eclipse.jface.preference.FieldEditorPreferencePage;\n+import org.eclipse.jface.preference.FileFieldEditor;\n+import org.eclipse.jface.preference.IPreferenceStore;\n+import org.eclipse.osgi.util.NLS;\n+import org.eclipse.ui.IWorkbench;\n+import org.eclipse.ui.IWorkbenchPreferencePage;\n+import org.jboss.tools.openshift.core.preferences.IOpenShiftCoreConstants;\n+import org.jboss.tools.openshift.internal.ui.OpenShiftUIActivator;\n+\n+/**\n+ * @author jeff.cantrill\n+ */\n+public class OpenShiftPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {\n+\n+\tprivate static final int SUCCESS = 0;\n+\n+\tprivate FileFieldEditor cliLocationEditor;\n+\t\n+\tprivate static final String OC_BINARY_NAME;\n+\tprivate static final String [] EXTENSIONS;\n+\tstatic {\n+\t\tif(SystemUtils.IS_OS_WINDOWS) {\n+\t\t\tEXTENSIONS = new String []{\"exe\"};\n+\t\t\tOC_BINARY_NAME = \"oc.exe\";\n+\t\t}else {\n+\t\t\tEXTENSIONS = new String []{};\n+\t\t\tOC_BINARY_NAME = \"oc\";\n+\t\t}\n+\t}\n+\n+\tpublic OpenShiftPreferencePage() {\n+\t\tsuper(GRID);\n+\t}\n+\n+\tpublic void createFieldEditors() {\n+\t\tthis.cliLocationEditor = \n+\t\t\t\tnew FileFieldEditor(\n+\t\t\t\t\t\tIOpenShiftCoreConstants.OPENSHIFT_CLI_LOC, \n+\t\t\t\t\t\tNLS.bind(\"{0} location\", OC_BINARY_NAME), getFieldEditorParent());\n+\t\tthis.cliLocationEditor.setFilterPath(SystemUtils.getUserHome());\n+\t\tthis.cliLocationEditor.setFileExtensions(EXTENSIONS);\n+\t\taddField(cliLocationEditor);\n+\t}\n+\n+\tpublic void init(IWorkbench workbench) {\n+\t\tIPreferenceStore store = OpenShiftUIActivator.getDefault().getCorePreferenceStore();\n+\t\tsetPreferenceStore(store);\n+\t\tString location = findOCLocation();\n+\t\tstore.setDefault(IOpenShiftCoreConstants.OPENSHIFT_CLI_LOC, location);\n+\t}\n+\t\n+\t\n+\t\n+\t@Override\n+\tprotected void performDefaults() {\n+\t\tsuper.performDefaults();\n+\n+\t}\n+\n+\tprivate String findOCLocation() {","path":"plugins/org.jboss.tools.openshift.ui/src/org/jboss/tools/openshift/internal/ui/preferences/OpenShiftPreferencePage.java","position":82,"original_position":82,"commit_id":"d4d6df87db1fbd9b12e1d3121b6def5898fcbaff","original_commit_id":"d4d6df87db1fbd9b12e1d3121b6def5898fcbaff","user":{"login":"adietish","id":25126,"avatar_url":"https://avatars.githubusercontent.com/u/25126?v=3","gravatar_id":"","url":"https://api.github.com/users/adietish","html_url":"https://github.com/adietish","followers_url":"https://api.github.com/users/adietish/followers","following_url":"https://api.github.com/users/adietish/following{/other_user}","gists_url":"https://api.github.com/users/adietish/gists{/gist_id}","starred_url":"https://api.github.com/users/adietish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adietish/subscriptions","organizations_url":"https://api.github.com/users/adietish/orgs","repos_url":"https://api.github.com/users/adietish/repos","events_url":"https://api.github.com/users/adietish/events{/privacy}","received_events_url":"https://api.github.com/users/adietish/received_events","type":"User","site_admin":false},"body":"this could then be put into the PortForwardingBinary#getLocation()","created_at":"2015-06-29T12:10:20Z","updated_at":"2015-06-29T12:10:20Z","html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/678#discussion_r33457100","pull_request_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678","_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments/33457100"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/678#discussion_r33457100"},"pull_request":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678"}}},"pull_request":{"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678","id":38702910,"html_url":"https://github.com/jbosstools/jbosstools-openshift/pull/678","diff_url":"https://github.com/jbosstools/jbosstools-openshift/pull/678.diff","patch_url":"https://github.com/jbosstools/jbosstools-openshift/pull/678.patch","issue_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/678","number":678,"state":"open","locked":false,"title":"[JBIDE-19850] Add port forwarding to a pod","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"body":"@adietish @maxandersen Port forwarding code for your initial review.  I still need to do some testing but it works in a similiar fashion to the v2 code.","created_at":"2015-06-27T03:06:59Z","updated_at":"2015-06-29T12:10:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2dd7e3fb8d7fde9a58121cc4ebc5fe77f7aaaf10","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678/commits","review_comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678/comments","review_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/678/comments","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/d4d6df87db1fbd9b12e1d3121b6def5898fcbaff","head":{"label":"jcantrill:19850_port_forwarding","ref":"19850_port_forwarding","sha":"d4d6df87db1fbd9b12e1d3121b6def5898fcbaff","user":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"repo":{"id":21654912,"name":"jbosstools-openshift","full_name":"jcantrill/jbosstools-openshift","owner":{"login":"jcantrill","id":4548408,"avatar_url":"https://avatars.githubusercontent.com/u/4548408?v=3","gravatar_id":"","url":"https://api.github.com/users/jcantrill","html_url":"https://github.com/jcantrill","followers_url":"https://api.github.com/users/jcantrill/followers","following_url":"https://api.github.com/users/jcantrill/following{/other_user}","gists_url":"https://api.github.com/users/jcantrill/gists{/gist_id}","starred_url":"https://api.github.com/users/jcantrill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcantrill/subscriptions","organizations_url":"https://api.github.com/users/jcantrill/orgs","repos_url":"https://api.github.com/users/jcantrill/repos","events_url":"https://api.github.com/users/jcantrill/events{/privacy}","received_events_url":"https://api.github.com/users/jcantrill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jcantrill/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":true,"url":"https://api.github.com/repos/jcantrill/jbosstools-openshift","forks_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/jcantrill/jbosstools-openshift/releases{/id}","created_at":"2014-07-09T14:19:31Z","updated_at":"2015-06-04T22:37:01Z","pushed_at":"2015-06-28T02:39:15Z","git_url":"git://github.com/jcantrill/jbosstools-openshift.git","ssh_url":"git@github.com:jcantrill/jbosstools-openshift.git","clone_url":"https://github.com/jcantrill/jbosstools-openshift.git","svn_url":"https://github.com/jcantrill/jbosstools-openshift","homepage":"","size":14219,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jbosstools:master","ref":"master","sha":"682dcc70c5dfef89ca7771353ae9ce26dcb3c041","user":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"repo":{"id":6308288,"name":"jbosstools-openshift","full_name":"jbosstools/jbosstools-openshift","owner":{"login":"jbosstools","id":619871,"avatar_url":"https://avatars.githubusercontent.com/u/619871?v=3","gravatar_id":"","url":"https://api.github.com/users/jbosstools","html_url":"https://github.com/jbosstools","followers_url":"https://api.github.com/users/jbosstools/followers","following_url":"https://api.github.com/users/jbosstools/following{/other_user}","gists_url":"https://api.github.com/users/jbosstools/gists{/gist_id}","starred_url":"https://api.github.com/users/jbosstools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jbosstools/subscriptions","organizations_url":"https://api.github.com/users/jbosstools/orgs","repos_url":"https://api.github.com/users/jbosstools/repos","events_url":"https://api.github.com/users/jbosstools/events{/privacy}","received_events_url":"https://api.github.com/users/jbosstools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jbosstools/jbosstools-openshift","description":"JBoss Tools :: OpenShift { openshift }","fork":false,"url":"https://api.github.com/repos/jbosstools/jbosstools-openshift","forks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/forks","keys_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/teams","hooks_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/hooks","issue_events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/events{/number}","events_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/events","assignees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/assignees{/user}","branches_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/branches{/branch}","tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/tags","blobs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/refs{/sha}","trees_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/{sha}","languages_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/languages","stargazers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/stargazers","contributors_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contributors","subscribers_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscribers","subscription_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/subscription","commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/commits{/sha}","git_commits_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/git/commits{/sha}","comments_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/comments{/number}","issue_comment_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/comments{/number}","contents_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/contents/{+path}","compare_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/merges","archive_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/downloads","issues_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues{/number}","pulls_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls{/number}","milestones_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/milestones{/number}","notifications_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/labels{/name}","releases_url":"https://api.github.com/repos/jbosstools/jbosstools-openshift/releases{/id}","created_at":"2012-10-20T11:23:01Z","updated_at":"2015-05-05T14:50:29Z","pushed_at":"2015-06-29T10:28:03Z","git_url":"git://github.com/jbosstools/jbosstools-openshift.git","ssh_url":"git@github.com:jbosstools/jbosstools-openshift.git","clone_url":"https://github.com/jbosstools/jbosstools-openshift.git","svn_url":"https://github.com/jbosstools/jbosstools-openshift","homepage":"","size":17735,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":6,"forks":28,"open_issues":6,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678"},"html":{"href":"https://github.com/jbosstools/jbosstools-openshift/pull/678"},"issue":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/678"},"comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/issues/678/comments"},"review_comments":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678/comments"},"review_comment":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/pulls/678/commits"},"statuses":{"href":"https://api.github.com/repos/jbosstools/jbosstools-openshift/statuses/d4d6df87db1fbd9b12e1d3121b6def5898fcbaff"}}}}