diff --git a/SeaweedFS-Java-Client.md b/SeaweedFS-Java-Client.md index 46b793c..4dd048f 100644 --- a/SeaweedFS-Java-Client.md +++ b/SeaweedFS-Java-Client.md @@ -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()); ``` \ No newline at end of file