From ddd06d6f4df008c81ea04c70260a9cdeb7ab5cf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20BAROTIN?= Date: Thu, 22 Apr 2021 23:03:16 +0200 Subject: [PATCH] Updated SeaweedFS Java Client (markdown) --- SeaweedFS-Java-Client.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/SeaweedFS-Java-Client.md b/SeaweedFS-Java-Client.md index 7fd2251..596cf82 100644 --- a/SeaweedFS-Java-Client.md +++ b/SeaweedFS-Java-Client.md @@ -66,3 +66,24 @@ The following is one implementation. It just watch the folder "/buckets" and all } } ``` + +## Standard file manipulation + +You can also use this API for standard file manipulation: directory listing, file touch, folder creation, file deletion, and recursive folder deletion. + +``` + FilerClient filerClient = new FilerClient("localhost", 18888); + + List entries = filerClient.listEntries("/"); + + for (FilerProto.Entry entry : entries) { + System.out.println(entry.toString()); + } + + filerClient.mkdirs("/new_folder", 0755); + filerClient.touch("/new_folder/new_empty_file", 0755); + filerClient.touch("/new_folder/new_empty_file2", 0755); + filerClient.rm("/new_folder/new_empty_file", false, true); + filerClient.rm("/new_folder", true, true); + +``` \ No newline at end of file