Lucene.Net.Index.TestIndexWriterLockRelease.SetUp C# (CSharp) Метод

SetUp() приватный Метод

private SetUp ( ) : void
Результат void
		public override void  SetUp()
		{
			base.SetUp();
			if (this.__test_dir == null)
			{
				System.String tmp_dir = AppSettings.Get("java.io.tmpdir", "tmp");
				this.__test_dir = new System.IO.DirectoryInfo(System.IO.Path.Combine(tmp_dir, "testIndexWriter"));
				
				bool tmpBool;
				if (System.IO.File.Exists(this.__test_dir.FullName))
					tmpBool = true;
				else
					tmpBool = System.IO.Directory.Exists(this.__test_dir.FullName);
				if (tmpBool)
				{
					throw new System.IO.IOException("test directory \"" + this.__test_dir.FullName + "\" already exists (please remove by hand)");
				}
				
				bool mustThrow = false;
				try
				{
					System.IO.Directory.CreateDirectory(this.__test_dir.FullName);
					if (!System.IO.Directory.Exists(this.__test_dir.FullName))
						mustThrow = true;
				}
				catch
				{
					mustThrow = true;
				}

				if (mustThrow)
					throw new System.IO.IOException("unable to create test directory \"" + this.__test_dir.FullName + "\"");
			}
		}