Updated SeaweedFS Java Client (markdown)

Chris Lu 2021-05-06 10:51:05 -07:00
parent 61318eec1d
commit 3a7d33147f

@ -95,4 +95,21 @@ You can also use this API for standard file manipulation: directory listing, fil
filerClient.rm("/new_folder/new_empty_file", false, true);
filerClient.rm("/new_folder", true, true);
```
## Advanced Usage
Sometimes you may need to go deeper. For example, change modification time `mtime`.
```
// load existing entry
FilerProto.Entry entry = filerClient.lookupEntry("/some/dir","entryName");
// change the attribute
FilerProto.Entry.Builder entryBuilder = FilerProto.Entry.newBuilder(entry);
FilerProto.FuseAttributes.Builder attrBuilder = FilerProto.FuseAttributes.newBuilder(entry.getAttributes());
attrBuilder.setMtime(...)
// save the new entry
entryBuilder.setAttributes(attrBuilder);
filerClient.updateEntry("/some/dir", entryBuilder.build());
```