diff options
| author | Chris Lu <chris.lu@gmail.com> | 2021-05-06 11:25:36 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2021-05-06 11:25:36 -0700 |
| commit | 28d58bac62a2721261dca9e0e90525eba272b02c (patch) | |
| tree | 0cea1ecd84ec1659b0883fa3402d952eee19f026 /other | |
| parent | 48601bce6c3d59c2931a288b17f6d6609d5a5666 (diff) | |
| download | seaweedfs-28d58bac62a2721261dca9e0e90525eba272b02c.tar.xz seaweedfs-28d58bac62a2721261dca9e0e90525eba272b02c.zip | |
another simple example
Diffstat (limited to 'other')
| -rw-r--r-- | other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile2.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile2.java b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile2.java new file mode 100644 index 000000000..61d8c290f --- /dev/null +++ b/other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile2.java @@ -0,0 +1,22 @@ +package com.seaweedfs.examples; + +import com.google.common.io.Files; +import seaweedfs.client.FilerClient; +import seaweedfs.client.SeaweedOutputStream; + +import java.io.File; +import java.io.IOException; + +public class ExampleWriteFile2 { + + public static void main(String[] args) throws IOException { + + FilerClient filerClient = new FilerClient("localhost", 18888); + + SeaweedOutputStream seaweedOutputStream = new SeaweedOutputStream(filerClient, "/test/1"); + Files.copy(new File("/etc/resolv.conf"), seaweedOutputStream); + seaweedOutputStream.close(); + + } + +} |
