Skip to content

Commit ee4805c

Browse files
committed
update readme
1 parent 25641b7 commit ee4805c

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ https://www.fusio-project.org/
1212
```java
1313
package org.fusioproject.sample;
1414

15+
import app.sdkgen.client.Credentials.OAuth2;
16+
import app.sdkgen.client.CredentialsInterface;
1517
import app.sdkgen.client.Exception.ClientException;
1618
import app.sdkgen.client.TokenStore.MemoryTokenStore;
1719
import app.sdkgen.client.TokenStoreInterface;
20+
import org.fusioproject.sdk.BackendOperationCollection;
1821
import org.fusioproject.sdk.Client;
19-
import org.fusioproject.sdk.backend.OperationCollection;
2022

2123
import java.util.ArrayList;
2224
import java.util.List;
@@ -28,13 +30,14 @@ public class Main {
2830
scopes.add("backend");
2931
TokenStoreInterface tokenStore = new MemoryTokenStore();
3032

31-
Client client = new Client("https://demo.fusio-project.org/", "test", "FRsNh1zKCXlB", scopes, tokenStore);
33+
CredentialsInterface credentials = new OAuth2("test", "FRsNh1zKCXlB", "https://demo.fusio-project.org/authorization/token", "", tokenStore, scopes);
34+
Client client = new Client("https://demo.fusio-project.org/", credentials);
3235

33-
OperationCollection operations = client.backend().operation().getAll(0, 16, "");
36+
BackendOperationCollection operations = client.backend().operation().getAll(0, 16, "");
3437

3538
System.out.println("Operations:");
36-
for (int i = 0; i < operations.getEntry().length; i++) {
37-
System.out.println("* " + operations.getEntry()[i].getHttpMethod() + " " + operations.getEntry()[i].getHttpPath());
39+
for (int i = 0; i < operations.getEntry().size(); i++) {
40+
System.out.println("* " + operations.getEntry().get(i).getHttpMethod() + " " + operations.getEntry().get(i).getHttpPath());
3841
}
3942
}
4043

0 commit comments

Comments
 (0)