public async Task AddFileAsync(FileContainerEntityParam param, Func <ISequentialWritable <byte>, CancellationToken, Task <bool> > composeProc, long?fileSizeHint = null, CancellationToken cancel = default)
        {
            param.Validate();

            using var doorHolder   = Door.Enter();
            using var cancelHolder = this.CreatePerTaskCancellationToken(out CancellationToken c, cancel);

            if (this.CanWrite == false)
            {
                throw new CoresException("Current state doesn't allow write operations.");
            }

            // 実装の新規ファイル作成を呼び出す
            SequentialWritableImpl <byte> obj = await AddFileAsyncImpl(param, fileSizeHint, c);

            try
            {
                // ユーザー提供の composeProc を呼び出す
                // これによりユーザーは ISequentialWritable に対して書き込み操作を実施する
                bool ok = await composeProc(obj, c);

                // 実装のファイル追加処理を完了させる
                await obj.CompleteAsync(ok, c);
            }
            catch
            {
                // 途中で何らかのエラーが発生した
                // 実装のファイル追加処理を失敗させる
                await obj.CompleteAsync(false, c);

                throw;
            }
        }