Skip to content

Commit 5945771

Browse files
committed
update readme
1 parent 45431a4 commit 5945771

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,36 @@ This is a simple Java CLI application which shows how to use the Java SDK to acc
88
In this example we simply output all registered routes.
99
Fusio is an open source API management which helps to build and manage great APIs more information at:
1010
https://www.fusio-project.org/
11+
12+
```java
13+
package org.fusioproject.sample;
14+
15+
import app.sdkgen.client.Exception.ClientException;
16+
import app.sdkgen.client.TokenStore.MemoryTokenStore;
17+
import app.sdkgen.client.TokenStoreInterface;
18+
import org.fusioproject.sdk.Client;
19+
import org.fusioproject.sdk.backend.OperationCollection;
20+
21+
import java.util.ArrayList;
22+
import java.util.List;
23+
24+
public class Main {
25+
26+
public static void main(String[] args) throws ClientException {
27+
List<String> scopes = new ArrayList<>();
28+
scopes.add("backend");
29+
TokenStoreInterface tokenStore = new MemoryTokenStore();
30+
31+
Client client = new Client("https://demo.fusio-project.org/", "test", "FRsNh1zKCXlB", scopes, tokenStore);
32+
33+
OperationCollection operations = client.backend().operation().getAll(0, 16, "");
34+
35+
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());
38+
}
39+
}
40+
41+
}
42+
43+
```

0 commit comments

Comments
 (0)