Lucene.Net.Store.CompoundFileDirectory.CompoundFileDirectory C# (CSharp) Method

CompoundFileDirectory() public method

Create a new CompoundFileDirectory.
public CompoundFileDirectory ( Lucene.Net.Store.Directory directory, string fileName, IOContext context, bool openForWrite ) : System.Collections.Generic
directory Lucene.Net.Store.Directory
fileName string
context IOContext
openForWrite bool
return System.Collections.Generic
        public CompoundFileDirectory(Directory directory, string fileName, IOContext context, bool openForWrite)
        {
            this.Directory_Renamed = directory;
            this.FileName = fileName;
            this.ReadBufferSize = BufferedIndexInput.BufferSize(context);
            this.isOpen = false;
            this.OpenForWrite = openForWrite;
            if (!openForWrite)
            {
                bool success = false;
                Handle = directory.CreateSlicer(fileName, context);
                try
                {
                    this.Entries = ReadEntries(Handle, directory, fileName);
                    success = true;
                }
                finally
                {
                    if (!success)
                    {
                        IOUtils.CloseWhileHandlingException(Handle);
                    }
                }
                this.isOpen = true;
                Writer = null;
            }
            else
            {
                Debug.Assert(!(directory is CompoundFileDirectory), "compound file inside of compound file: " + fileName);
                this.Entries = SENTINEL;
                this.isOpen = true;
                Writer = new CompoundFileWriter(directory, fileName);
                Handle = null;
            }
        }