DBreeze.Storage.FSR.RestoreTableFromTheOtherTable C# (CSharp) Method

RestoreTableFromTheOtherTable() public method

public RestoreTableFromTheOtherTable ( string newTableFullPath ) : void
newTableFullPath string
return void
        public void RestoreTableFromTheOtherTable(string newTableFullPath)
        {
            lock (lock_fs)
            {
                if (_fsData != null)
                {
                    _fsData.Dispose();
                    _fsData = null;
                }

                if (_fsRollback != null)
                {
                    _fsRollback.Dispose();
                    _fsRollback = null;
                }

                if (_fsRollbackHelper != null)
                {
                    _fsRollbackHelper.Dispose();
                    _fsRollbackHelper = null;
                }

                _randBuf.Clear();
                _rollbackCache.Clear();
                usedBufferSize = 0;
                eofRollback = 0;
                eofData = 0;
                _seqBuf.Clear(true);

                this._configuration.FSFactory.Delete(this._fileName);
                this._configuration.FSFactory.Delete(this._fileName + ".rol");
                this._configuration.FSFactory.Delete(this._fileName + ".rhp");
                //File.Delete(this._fileName);
                //File.Delete(this._fileName + ".rol");
                //File.Delete(this._fileName + ".rhp");

                if (this._configuration.FSFactory.Exists(newTableFullPath))
                    this._configuration.FSFactory.Move(newTableFullPath, this._fileName);

                if(this._configuration.FSFactory.Exists(newTableFullPath + ".rol"))
                    this._configuration.FSFactory.Move(newTableFullPath + ".rol", this._fileName + ".rol");

                if (this._configuration.FSFactory.Exists(newTableFullPath + ".rhp"))
                    this._configuration.FSFactory.Move(newTableFullPath + ".rhp", this._fileName + ".rhp");

                InitFiles();

            }
        }