コード例 #1
0
 /// <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));
     }
 }
コード例 #2
0
ファイル: Db4oDefragSolo.cs プロジェクト: Galigator/db4o
		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);
		}
コード例 #3
0
 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);
         }
     }
 }
コード例 #4
0
 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);
         }
     }
 }
コード例 #5
0
 protected override void DoClean()
 {
     if (_databaseFile.Exists())
     {
         _databaseFile.Delete();
     }
 }
コード例 #6
0
ファイル: Db4oDefragSolo.cs プロジェクト: pondyond/db4o
        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));
        }
コード例 #7
0
ファイル: Config4Impl.cs プロジェクト: pondyond/db4o
        /// <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));
            }
        }
コード例 #8
0
		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();
		}
コード例 #9
0
        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();
        }
コード例 #10
0
		/// <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));
			}
		}
コード例 #11
0
ファイル: Config4Impl.cs プロジェクト: masroore/db4o
 /// <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));
     }
 }