@Override public INodeFileUnderConstruction recordModification(final Snapshot latest, final INodeMap inodeMap) throws QuotaExceededException { if (isInLatestSnapshot(latest)) { INodeFileUnderConstructionWithSnapshot newFile = getParent() .replaceChild4INodeFileUcWithSnapshot(this, inodeMap) .recordModification(latest, inodeMap); return newFile; } else { return this; } }
/** Replace a child {@link INodeFile} with an {@link INodeFileUnderConstructionWithSnapshot}. */ INodeFileUnderConstructionWithSnapshot replaceChild4INodeFileUcWithSnapshot( final INodeFileUnderConstruction child, final INodeMap inodeMap) { Preconditions.checkArgument(!(child instanceof INodeFileUnderConstructionWithSnapshot), "Child file is already an INodeFileUnderConstructionWithSnapshot, child=" + child); final INodeFileUnderConstructionWithSnapshot newChild = new INodeFileUnderConstructionWithSnapshot(child, null); replaceChildFile(child, newChild, inodeMap); return newChild; }