Package convex.dlfs
Class DLFSNode
java.lang.Object
convex.dlfs.DLFSNode
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateDirectory
(CVMLong timestamp) createEmptyFile
(CVMLong timestamp) createTombstone
(CVMLong timestamp) static ABlob
Gets the data from a DLFS file node, or nil if not a regular FilegetDirectoryEntries
(AVector<ACell> dirNode) Gets the directory entries for a nodegetDirectoryEntry
(AVector<ACell> node, AString name) static Blob
getMetaData
(AVector<ACell> node) Gets the metadata from a DLFS nodestatic CVMLong
Gets the metadata from a DLFS nodestatic boolean
isDirectory
(AVector<ACell> node) static boolean
isRegularFile
(AVector<ACell> node) static boolean
isTombstone
(AVector<ACell> node) Returns true iff the node is a DLFS tombstoneMerges two DLFS nodes recursively.Navigate down a path relative to a DLFS Node.Update a node at a path relative to a root node
-
Field Details
-
NODE_LENGTH
public static final long NODE_LENGTH- See Also:
-
POS_DIR
public static final int POS_DIR- See Also:
-
POS_DATA
public static final int POS_DATA- See Also:
-
POS_METADATA
public static final int POS_METADATA- See Also:
-
POS_UTIME
public static final int POS_UTIME- See Also:
-
-
Constructor Details
-
DLFSNode
public DLFSNode()
-
-
Method Details
-
isDirectory
-
isRegularFile
-
getDirectoryEntries
-
updateNode
public static AVector<ACell> updateNode(AVector<ACell> rootNode, DLPath path, AVector<ACell> newNode, CVMLong utime) Update a node at a path relative to a root node- Parameters:
rootNode
- Root node of file systempath
- Path relative to rootnewNode
- New node, or null to delete a nodeutime
- Timestamp to set on any directories changed- Returns:
- Updated root node, or null if update failed (parent(s) not a directory)
-
getData
-
getMetaData
-
getUTime
-
getDirectoryEntry
-
isTombstone
-
createTombstone
-
createDirectory
-
createEmptyFile
-
merge
Merges two DLFS nodes recursively. Favours newer (utime) entries in case of conflicts.- Parameters:
a
- First node (non-null). Favoured in result if all else equal.b
- Second node (non-null)time
- Update time for merged changes- Returns:
- Merged node
-