blob: 19e067768cddd8c1071ab954dca3ff01e7995d0b [file] [log] [blame]
Matthias Andreas Benkard4e8423d2021-12-19 22:56:09 +01001package eu.mulk.jgvariant.ostree;
2
3import eu.mulk.jgvariant.core.Decoder;
4import java.nio.ByteOrder;
5import java.util.List;
6
7/**
8 * Permission bits and extended attributes for a file.
9 *
10 * <p>Reference: {@code ostree-core.h#OSTREE_FILEMETA_GVARIANT_STRING}
11 */
12public record FileMeta(int uid, int gid, int mode, List<Xattr> xattrs) {
13
14 private static final Decoder<FileMeta> DECODER =
15 Decoder.ofStructure(
16 FileMeta.class,
17 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
18 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
19 Decoder.ofInt().withByteOrder(ByteOrder.BIG_ENDIAN),
20 Decoder.ofArray(Xattr.decoder()));
21
22 public static Decoder<FileMeta> decoder() {
23 return DECODER;
24 }
25}