Skip to content

Commit e9946e1

Browse files
lbobryanneozwu
authored andcommitted
Adds command line sample for the Street View Publish API v1. (google#12)
* Adds command line sample for the Street View Publish API v1. * Add explicit dependency to Google GAX and remove wildcard imports.
1 parent 0b5c789 commit e9946e1

File tree

11 files changed

+936
-0
lines changed

11 files changed

+936
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src/main/java"/>
4+
<classpathentry kind="src" path="src/main/resources"/>
5+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
6+
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
7+
<classpathentry kind="output" path="target/classes"/>
8+
</classpath>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>streetview-publish-cmdline-sample</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.m2e.core.maven2Builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.jdt.core.javanature</nature>
21+
<nature>org.eclipse.m2e.core.maven2Nature</nature>
22+
</natures>
23+
</projectDescription>

streetview-publish-cmdline-sample/.settings/org.eclipse.jdt.core.prefs

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
cleanup.add_default_serial_version_id=true
2+
cleanup.add_generated_serial_version_id=false
3+
cleanup.add_missing_annotations=true
4+
cleanup.add_missing_deprecated_annotations=true
5+
cleanup.add_missing_methods=false
6+
cleanup.add_missing_nls_tags=false
7+
cleanup.add_missing_override_annotations=true
8+
cleanup.add_serial_version_id=true
9+
cleanup.always_use_blocks=true
10+
cleanup.always_use_parentheses_in_expressions=false
11+
cleanup.always_use_this_for_non_static_field_access=false
12+
cleanup.always_use_this_for_non_static_method_access=false
13+
cleanup.convert_to_enhanced_for_loop=false
14+
cleanup.correct_indentation=true
15+
cleanup.format_source_code=true
16+
cleanup.format_source_code_changes_only=false
17+
cleanup.make_local_variable_final=true
18+
cleanup.make_parameters_final=false
19+
cleanup.make_private_fields_final=true
20+
cleanup.make_type_abstract_if_missing_method=false
21+
cleanup.make_variable_declarations_final=false
22+
cleanup.never_use_blocks=false
23+
cleanup.never_use_parentheses_in_expressions=true
24+
cleanup.organize_imports=true
25+
cleanup.qualify_static_field_accesses_with_declaring_class=false
26+
cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
27+
cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
28+
cleanup.qualify_static_member_accesses_with_declaring_class=true
29+
cleanup.qualify_static_method_accesses_with_declaring_class=false
30+
cleanup.remove_private_constructors=true
31+
cleanup.remove_trailing_whitespaces=true
32+
cleanup.remove_trailing_whitespaces_all=true
33+
cleanup.remove_trailing_whitespaces_ignore_empty=false
34+
cleanup.remove_unnecessary_casts=true
35+
cleanup.remove_unnecessary_nls_tags=true
36+
cleanup.remove_unused_imports=true
37+
cleanup.remove_unused_local_variables=false
38+
cleanup.remove_unused_private_fields=true
39+
cleanup.remove_unused_private_members=false
40+
cleanup.remove_unused_private_methods=true
41+
cleanup.remove_unused_private_types=true
42+
cleanup.sort_members=false
43+
cleanup.sort_members_all=false
44+
cleanup.use_blocks=true
45+
cleanup.use_blocks_only_for_return_and_throw=false
46+
cleanup.use_parentheses_in_expressions=true
47+
cleanup.use_this_for_non_static_field_access=true
48+
cleanup.use_this_for_non_static_field_access_only_if_necessary=true
49+
cleanup.use_this_for_non_static_method_access=true
50+
cleanup.use_this_for_non_static_method_access_only_if_necessary=true
51+
cleanup_profile=_google-api-java-client
52+
cleanup_settings_version=2
53+
eclipse.preferences.version=1
54+
editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
55+
formatter_profile=_google-api-java-client 100
56+
formatter_settings_version=12
57+
org.eclipse.jdt.ui.exception.name=exception
58+
org.eclipse.jdt.ui.gettersetter.use.is=false
59+
org.eclipse.jdt.ui.ignorelowercasenames=true
60+
org.eclipse.jdt.ui.importorder=com;org;;java;javax;
61+
org.eclipse.jdt.ui.javadoc=true
62+
org.eclipse.jdt.ui.keywordthis=false
63+
org.eclipse.jdt.ui.ondemandthreshold=999
64+
org.eclipse.jdt.ui.overrideannotation=true
65+
org.eclipse.jdt.ui.staticondemandthreshold=999
66+
org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/*\n * Copyright (c) 2011 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http\://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author ${user}@google.com (Your Name Here)\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * @author Yaniv Inbar\n *\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-JSDoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
67+
sp_cleanup.add_default_serial_version_id=true
68+
sp_cleanup.add_generated_serial_version_id=false
69+
sp_cleanup.add_missing_annotations=true
70+
sp_cleanup.add_missing_deprecated_annotations=true
71+
sp_cleanup.add_missing_methods=false
72+
sp_cleanup.add_missing_nls_tags=false
73+
sp_cleanup.add_missing_override_annotations=true
74+
sp_cleanup.add_missing_override_annotations_interface_methods=false
75+
sp_cleanup.add_serial_version_id=false
76+
sp_cleanup.always_use_blocks=true
77+
sp_cleanup.always_use_parentheses_in_expressions=false
78+
sp_cleanup.always_use_this_for_non_static_field_access=false
79+
sp_cleanup.always_use_this_for_non_static_method_access=false
80+
sp_cleanup.convert_to_enhanced_for_loop=false
81+
sp_cleanup.correct_indentation=false
82+
sp_cleanup.format_source_code=false
83+
sp_cleanup.format_source_code_changes_only=false
84+
sp_cleanup.make_local_variable_final=false
85+
sp_cleanup.make_parameters_final=false
86+
sp_cleanup.make_private_fields_final=true
87+
sp_cleanup.make_type_abstract_if_missing_method=false
88+
sp_cleanup.make_variable_declarations_final=true
89+
sp_cleanup.never_use_blocks=false
90+
sp_cleanup.never_use_parentheses_in_expressions=true
91+
sp_cleanup.on_save_use_additional_actions=false
92+
sp_cleanup.organize_imports=true
93+
sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
94+
sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
95+
sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
96+
sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
97+
sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
98+
sp_cleanup.remove_private_constructors=true
99+
sp_cleanup.remove_trailing_whitespaces=false
100+
sp_cleanup.remove_trailing_whitespaces_all=true
101+
sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
102+
sp_cleanup.remove_unnecessary_casts=true
103+
sp_cleanup.remove_unnecessary_nls_tags=false
104+
sp_cleanup.remove_unused_imports=false
105+
sp_cleanup.remove_unused_local_variables=false
106+
sp_cleanup.remove_unused_private_fields=true
107+
sp_cleanup.remove_unused_private_members=false
108+
sp_cleanup.remove_unused_private_methods=true
109+
sp_cleanup.remove_unused_private_types=true
110+
sp_cleanup.sort_members=false
111+
sp_cleanup.sort_members_all=false
112+
sp_cleanup.use_blocks=false
113+
sp_cleanup.use_blocks_only_for_return_and_throw=false
114+
sp_cleanup.use_parentheses_in_expressions=false
115+
sp_cleanup.use_this_for_non_static_field_access=false
116+
sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
117+
sp_cleanup.use_this_for_non_static_method_access=false
118+
sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
3+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
4+
<listEntry value="/streetview-publish-cmdline-sample/src/main/java/com/google/api/services/samples/streetview/publish/cmdline/StreetViewPublishSample.java"/>
5+
</listAttribute>
6+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
7+
<listEntry value="1"/>
8+
</listAttribute>
9+
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.m2e.launchconfig.classpathProvider"/>
10+
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.google.api.services.samples.streetview.publish.cmdline.StreetViewPublishSample"/>
11+
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="streetview-publish-cmdline-sample"/>
12+
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.m2e.launchconfig.sourcepathProvider"/>
13+
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Djava.util.logging.config.file=${project_loc:streetview-publish-cmdline-sample}/logging.properties"/>
14+
</launchConfiguration>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<html>
2+
<title>streetview-publish-cmdline-sample</title>
3+
<body>
4+
<h2>Instructions for the Street View Publish API V1 Command-Line Sample</h2>
5+
6+
<h3>Register Your Application</h3>
7+
8+
<ul>
9+
<li>Visit the <a href="https://console.cloud.google.com/apis/library">Google Cloud
10+
console</a> and enable the Street View Publish API for your project. If
11+
you do not have a project, you will need to create one before you do this.
12+
</li>
13+
<li>Go to the <a href="https://console.cloud.google.com/apis/credentials">credentials
14+
page</a> for your project.
15+
</li>
16+
<li>Click "Create Credentials" and then "Help me Choose."</li>
17+
<li>For "Which API are you using?" enter "Street View Publish API."</li>
18+
<li>For "Where will you be calling the API from?" enter "Other UI (e.g. Windows, CLI tool)."</li>
19+
<li>For "What data will you be accessing?" enter "User data."</li>
20+
<li>Click "What credentials do I need?"</li>
21+
<li>Follow the steps to create your credentials.</li>
22+
<li>Find your credentials on the <a href="https://console.cloud.google.com/apis/credentials">credentials
23+
page</a>, click on the entry, and then click "Download JSON." Copy the
24+
downloaded file (e.g. <code>~/Downloads/client_secrets.json</code> to
25+
<a href="src/main/resources/client_secrets.json">src/main/resources/client_secrets.json</a>.
26+
If you skip this step, when trying to run the sample you will get a <code>400
27+
INVALID_CLIENT</code> error in the browser.
28+
</li>
29+
</ul>
30+
31+
<h3>Checkout Instructions</h3>
32+
33+
<p>
34+
<b>Prerequisites:</b> install <a href="http://java.com">Java 6</a>, <a
35+
href="https://git-scm.com/downloads">Git</a>, and <a
36+
href="http://maven.apache.org/download.html">Maven</a>. You may need to
37+
set your
38+
<code>JAVA_HOME</code>
39+
.
40+
</p>
41+
42+
<pre>
43+
cd <i>[someDirectory]</i>
44+
git clone https://github.com/google/google-api-java-client-samples.git
45+
cd google-api-java-client-samples/streetview-publish-cmdline-sample
46+
cp ~/Downloads/client_secrets.json src/main/resources/client_secrets.json
47+
mvn compile
48+
mvn -q exec:java
49+
</pre>
50+
51+
<p>To enable logging of HTTP requests and responses (highly recommended
52+
when developing), please take a look at <a href="logging.properties">logging.properties</a>.</p>
53+
54+
</body>
55+
</html>

0 commit comments

Comments
 (0)