Skip to content
This repository was archived by the owner on Feb 4, 2019. It is now read-only.

Commit 6401800

Browse files
jtjknacx
authored andcommitted
Added oauth.endpoint property
1 parent abc789d commit 6401800

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • compute-basics/src/main/java/org/jclouds/examples/compute/basics

compute-basics/src/main/java/org/jclouds/examples/compute/basics/MainApp.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ public static enum Action {
101101
public static int PARAMETERS = 5;
102102
public static String INVALID_SYNTAX = "Invalid number of parameters. Syntax is: provider identity credential groupName (add|exec|run|destroy)";
103103

104+
public static final String PROPERTY_OAUTH_ENDPOINT = "oauth.endpoint";
105+
104106
public static void main(String[] args) {
105107
if (args.length < PARAMETERS)
106108
throw new IllegalArgumentException(INVALID_SYNTAX);
@@ -268,6 +270,12 @@ private static ComputeService initComputeService(String provider, String identit
268270
long scriptTimeout = TimeUnit.MILLISECONDS.convert(20, TimeUnit.MINUTES);
269271
properties.setProperty(TIMEOUT_SCRIPT_COMPLETE, scriptTimeout + "");
270272

273+
// set oauth endpoint property if set in system property
274+
String oAuthEndpoint = System.getProperty(PROPERTY_OAUTH_ENDPOINT);
275+
if (oAuthEndpoint != null) {
276+
properties.setProperty(PROPERTY_OAUTH_ENDPOINT, oAuthEndpoint);
277+
}
278+
271279
// example of injecting a ssh implementation
272280
Iterable<Module> modules = ImmutableSet.<Module> of(
273281
new SshjSshClientModule(),

0 commit comments

Comments
 (0)