mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Updated SeaweedFS Java Client (markdown)
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());
|
||||
```
|
Loading…
Reference in a new issue