if (getFileSystem().isReadOnly()) {
throw new ReadOnlyFileSystemException();
}
Catalog catalog = ((HfsPlusFileSystem) getFileSystem()).getCatalog();
SuperBlock volumeHeader = ((HfsPlusFileSystem) getFileSystem()).getVolumeHeader();
CatalogLeafNode node =
catalog.createNode(name, this.folder.getFolderId(),
new CatalogNodeId(volumeHeader.getNextCatalogId()),
CatalogFolder.RECORD_TYPE_FOLDER_THREAD);
folder.incrementValence();
HfsPlusEntry newEntry =
new HfsPlusEntry((HfsPlusFileSystem) getFileSystem(), this, name, node.getNodeRecord(0));
newEntry.setDirty();
volumeHeader.incrementFolderCount();
log.debug("New volume header :\n" + volumeHeader.toString());
volumeHeader.update();