This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git


The following commit(s) were added to refs/heads/main by this push:
     new faa574f83 docs(bindings/java): add basic usage in README (#3534)
faa574f83 is described below

commit faa574f8343bd716236b79d82f86c4c3d0170703
Author: caicancai <[email protected]>
AuthorDate: Sun Nov 12 21:37:29 2023 +0800

    docs(bindings/java): add basic usage in README (#3534)
    
    Co-authored-by: tison <[email protected]>
---
 bindings/java/README.md | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/bindings/java/README.md b/bindings/java/README.md
index 9b3a11e5f..57e33589b 100644
--- a/bindings/java/README.md
+++ b/bindings/java/README.md
@@ -6,6 +6,26 @@
 
 
![](https://github.com/apache/incubator-opendal/assets/5351546/87bbf6e5-f19e-449a-b368-3e283016c887)
 
+## Example
+
+```java
+import java.util.HashMap;
+import java.util.Map;
+import org.apache.opendal.Operator;
+
+public class Main {
+    public static void main(String[] args) {
+        final Map<String, String> conf = new HashMap<>();
+        conf.put("root", "/tmp");
+
+        try (Operator op = Operator.of("fs", conf)) {
+            op.write("/path/to/data","Hello world").join();
+            System.out.println(new String(op.read("/path/to/data").join()));
+        }
+    }
+}
+```
+
 ## Getting Started
 
 This project is built upon the native OpenDAL lib. And it is released for 
multiple platforms that you can use a classifier to specify the platform you 
are building the application on.

Reply via email to