From 28d58bac62a2721261dca9e0e90525eba272b02c Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 6 May 2021 11:25:36 -0700 Subject: [PATCH] another simple example --- .../seaweedfs/examples/ExampleWriteFile2.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 other/java/examples/src/main/java/com/seaweedfs/examples/ExampleWriteFile2.java 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(); + + } + +}