NodeDescriptor nd =
new NodeDescriptor(0, 0, NodeDescriptor.BT_LEAF_NODE, 1,
params.getInitializeNumRecords());
CatalogLeafNode rootNode = new CatalogLeafNode(nd, nodeSize);
// First record (folder)
HfsUnicodeString name = new HfsUnicodeString(params.getVolumeName());
CatalogKey ck = new CatalogKey(CatalogNodeId.HFSPLUS_POR_CNID, name);
CatalogFolder folder =
new CatalogFolder(params.isJournaled() ? 2 : 0, CatalogNodeId.HFSPLUS_ROOT_CNID);
LeafRecord record = new LeafRecord(ck, folder.getBytes());
rootNode.addNodeRecord(record);
// Second record (thread)
CatalogKey tck = new CatalogKey(CatalogNodeId.HFSPLUS_POR_CNID, name);
CatalogThread ct =
new CatalogThread(CatalogFolder.RECORD_TYPE_FOLDER_THREAD,
CatalogNodeId.HFSPLUS_ROOT_CNID, new HfsUnicodeString(""));
record = new LeafRecord(tck, ct.getBytes());
rootNode.addNodeRecord(record);
log.debug(rootNode.toString());
return rootNode;
}