Skip to content

Commit 25641b7

Browse files
committed
update
1 parent 5945771 commit 25641b7

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>org.fusioproject</groupId>
44
<artifactId>sample-javacli</artifactId>
5-
<version>0.1.0</version>
5+
<version>0.2.0</version>
66
<packaging>jar</packaging>
77
<url>https://www.fusio-project.org/</url>
88
<build>
@@ -22,7 +22,7 @@
2222
<dependency>
2323
<groupId>org.fusio-project</groupId>
2424
<artifactId>sdk</artifactId>
25-
<version>1.0.5</version>
25+
<version>3.0.0</version>
2626
</dependency>
2727
</dependencies>
2828
</project>

src/main/java/org/fusioproject/sample/Main.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package org.fusioproject.sample;
22

3+
import app.sdkgen.client.Credentials.OAuth2;
4+
import app.sdkgen.client.CredentialsInterface;
35
import app.sdkgen.client.Exception.ClientException;
46
import app.sdkgen.client.TokenStore.MemoryTokenStore;
57
import app.sdkgen.client.TokenStoreInterface;
8+
import org.fusioproject.sdk.BackendOperationCollection;
69
import org.fusioproject.sdk.Client;
7-
import org.fusioproject.sdk.backend.OperationCollection;
810

911
import java.util.ArrayList;
1012
import java.util.List;
@@ -16,13 +18,14 @@ public static void main(String[] args) throws ClientException {
1618
scopes.add("backend");
1719
TokenStoreInterface tokenStore = new MemoryTokenStore();
1820

19-
Client client = new Client("https://demo.fusio-project.org/", "test", "FRsNh1zKCXlB", scopes, tokenStore);
21+
CredentialsInterface credentials = new OAuth2("test", "FRsNh1zKCXlB", "https://demo.fusio-project.org/authorization/token", "", tokenStore, scopes);
22+
Client client = new Client("https://demo.fusio-project.org/", credentials);
2023

21-
OperationCollection operations = client.backend().operation().getAll(0, 16, "");
24+
BackendOperationCollection operations = client.backend().operation().getAll(0, 16, "");
2225

2326
System.out.println("Operations:");
24-
for (int i = 0; i < operations.getEntry().length; i++) {
25-
System.out.println("* " + operations.getEntry()[i].getHttpMethod() + " " + operations.getEntry()[i].getHttpPath());
27+
for (int i = 0; i < operations.getEntry().size(); i++) {
28+
System.out.println("* " + operations.getEntry().get(i).getHttpMethod() + " " + operations.getEntry().get(i).getHttpPath());
2629
}
2730
}
2831

0 commit comments

Comments
 (0)