Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

another simple example

Chris Lu28d58bac62a2
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 0000000000..61d8c290f8
--- /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();
+
+ }
+
+}