/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { Sharpen.IO.File file = new Sharpen.IO.File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(37, path)); } }
protected override IObjectContainer CreateDatabase(IConfiguration config) { Sharpen.IO.File origFile = new Sharpen.IO.File(GetAbsolutePath()); if (origFile.Exists()) { try { string backupFile = GetAbsolutePath() + ".defrag.backup"; IIdMapping mapping = new InMemoryIdMapping(); // new // BTreeIDMapping(getAbsolutePath()+".defrag.mapping",4096,1,1000); DefragmentConfig defragConfig = new DefragmentConfig(GetAbsolutePath(), backupFile , mapping); defragConfig.ForceBackupDelete(true); // FIXME Cloning is ugly - wrap original in Decorator within // DefragContext instead? IConfiguration clonedConfig = (IConfiguration)((IDeepClone)config).DeepClone(null ); defragConfig.Db4oConfig(clonedConfig); Db4objects.Db4o.Defragment.Defragment.Defrag(defragConfig, new _IDefragmentListener_30 ()); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } } return base.CreateDatabase(config); }
private void Defrag(IConfiguration config) { Sharpen.IO.File origFile = new Sharpen.IO.File(GetAbsolutePath()); if (origFile.Exists()) { try { string backupFile = GetAbsolutePath() + ".defrag.backup"; IIdMapping mapping = new InMemoryIdMapping(); // new // BTreeIDMapping(getAbsolutePath()+".defrag.mapping",4096,1,1000); DefragmentConfig defragConfig = new DefragmentConfig(GetAbsolutePath(), backupFile , mapping); defragConfig.ForceBackupDelete(true); // FIXME Cloning is ugly - wrap original in Decorator within // DefragContext instead? IConfiguration clonedConfig = (IConfiguration)((IDeepClone)config).DeepClone(null ); defragConfig.Db4oConfig(clonedConfig); Db4objects.Db4o.Defragment.Defragment.Defrag(defragConfig, new _IDefragmentListener_64 ()); } catch (IOException e) { Sharpen.Runtime.PrintStackTrace(e); } } }
private void Defrag(IConfiguration config) { var origFile = new File(GetAbsolutePath()); if (origFile.Exists()) { try { var backupFile = GetAbsolutePath() + ".defrag.backup"; IIdMapping mapping = new InMemoryIdMapping(); // new // BTreeIDMapping(getAbsolutePath()+".defrag.mapping",4096,1,1000); var defragConfig = new DefragmentConfig(GetAbsolutePath(), backupFile , mapping); defragConfig.ForceBackupDelete(true); // FIXME Cloning is ugly - wrap original in Decorator within // DefragContext instead? var clonedConfig = (IConfiguration) ((IDeepClone) config).DeepClone(null ); defragConfig.Db4oConfig(clonedConfig); Db4objects.Db4o.Defragment.Defragment.Defrag(defragConfig, new _IDefragmentListener_64 ()); } catch (IOException e) { Runtime.PrintStackTrace(e); } } }
protected override void DoClean() { if (_databaseFile.Exists()) { _databaseFile.Delete(); } }
protected override IObjectContainer CreateDatabase(IConfiguration config) { var origFile = new File(GetAbsolutePath()); if (origFile.Exists()) { try { var backupFile = GetAbsolutePath() + ".defrag.backup"; IIdMapping mapping = new InMemoryIdMapping(); // new // BTreeIDMapping(getAbsolutePath()+".defrag.mapping",4096,1,1000); var defragConfig = new DefragmentConfig(GetAbsolutePath(), backupFile , mapping); defragConfig.ForceBackupDelete(true); // FIXME Cloning is ugly - wrap original in Decorator within // DefragContext instead? var clonedConfig = (IConfiguration)((IDeepClone)config).DeepClone(null ); defragConfig.Db4oConfig(clonedConfig); Db4objects.Db4o.Defragment.Defragment.Defrag(defragConfig, new _IDefragmentListener_30 ()); } catch (IOException e) { Runtime.PrintStackTrace(e); } } return(base.CreateDatabase(config)); }
/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { var file = new File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Messages.Get(37, path)); } }
private void Prepare() { Sharpen.IO.File file = new Sharpen.IO.File(TempFile()); if (file.Exists()) { file.Delete(); } IObjectContainer testDB = OpenDB(); DefragEncryptedFileTestCase.Item item = new DefragEncryptedFileTestCase.Item("richard" , 100); testDB.Store(item); testDB.Close(); }
private void Prepare() { Sharpen.IO.File file = new Sharpen.IO.File(TempFile()); if (file.Exists()) { file.Delete(); } IObjectContainer testDB = OpenDB(); DefragEncryptedFileTestCase.Item item = new DefragEncryptedFileTestCase.Item("richard" , 100); testDB.Store(item); testDB.Close(); }
/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { Sharpen.IO.File file = new Sharpen.IO.File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Db4objects.Db4o.Internal.Messages.Get(37, path)); } }
/// <exception cref="System.IO.IOException"></exception> internal void EnsureDirExists(string path) { var file = new File(path); if (!file.Exists()) { file.Mkdirs(); } if (file.Exists() && file.IsDirectory()) { } else { throw new IOException(Messages.Get(37, path)); } }