亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fsdirectory.cs

?? 介紹有關全文檢索的類庫,以lucene為例,在.net環境下實現多種類型文檔的全文檢索.
?? CS
?? 第 1 頁 / 共 2 頁
字號:
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

using System;

using IndexFileNameFilter = Lucene.Net.Index.IndexFileNameFilter;
// Used only for WRITE_LOCK_NAME in deprecated create=true case:
using IndexWriter = Lucene.Net.Index.IndexWriter;

namespace Lucene.Net.Store
{
	
	/// <summary> Straightforward implementation of {@link Directory} as a directory of files.
	/// Locking implementation is by default the {@link SimpleFSLockFactory}, but
	/// can be changed either by passing in a {@link LockFactory} instance to
	/// <code>getDirectory</code>, or specifying the LockFactory class by setting
	/// <code>Lucene.Net.Store.FSDirectoryLockFactoryClass</code> Java system
	/// property, or by calling {@link #setLockFactory} after creating
	/// the Directory.
	/// <p>Directories are cached, so that, for a given canonical
	/// path, the same FSDirectory instance will always be
	/// returned by <code>getDirectory</code>.  This permits
	/// synchronization on directories.</p>
	/// 
	/// </summary>
	/// <seealso cref="Directory">
	/// </seealso>
	/// <author>  Doug Cutting
	/// </author>
	public class FSDirectory : Directory
	{
		
		/// <summary>This cache of directories ensures that there is a unique Directory
		/// instance per path, so that synchronization on the Directory can be used to
		/// synchronize access between readers and writers.  We use
		/// refcounts to ensure when the last use of an FSDirectory
		/// instance for a given canonical path is closed, we remove the
		/// instance from the cache.  See LUCENE-776
		/// for some relevant discussion.
		/// </summary>
		private static readonly System.Collections.Hashtable DIRECTORIES = System.Collections.Hashtable.Synchronized(new System.Collections.Hashtable());
		
		private static bool disableLocks = false;
		
		// TODO: should this move up to the Directory base class?  Also: should we
		// make a per-instance (in addition to the static "default") version?
		
		/// <summary> Set whether Lucene's use of lock files is disabled. By default, 
		/// lock files are enabled. They should only be disabled if the index
		/// is on a read-only medium like a CD-ROM.
		/// </summary>
		public static void  SetDisableLocks(bool doDisableLocks)
		{
			FSDirectory.disableLocks = doDisableLocks;
		}
		
		/// <summary> Returns whether Lucene's use of lock files is disabled.</summary>
		/// <returns> true if locks are disabled, false if locks are enabled.
		/// </returns>
		public static bool GetDisableLocks()
		{
			return FSDirectory.disableLocks;
		}
		
		/// <summary> Directory specified by <code>Lucene.Net.lockDir</code>
		/// or <code>java.io.tmpdir</code> system property.
		/// </summary>
		/// <deprecated> As of 2.1, <code>LOCK_DIR</code> is unused
		/// because the write.lock is now stored by default in the
		/// index directory.  If you really want to store locks
		/// elsewhere you can create your own {@link
		/// SimpleFSLockFactory} (or {@link NativeFSLockFactory},
		/// etc.) passing in your preferred lock directory.  Then,
		/// pass this <code>LockFactory</code> instance to one of
		/// the <code>getDirectory</code> methods that take a
		/// <code>lockFactory</code> (for example, {@link #GetDirectory(String, LockFactory)}).
		/// </deprecated>
		public static readonly System.String LOCK_DIR = SupportClass.AppSettings.Get("Lucene.Net.lockDir", System.IO.Path.GetTempPath());
		
		/// <summary>The default class which implements filesystem-based directories. </summary>
		private static System.Type IMPL;
		
		private static System.Security.Cryptography.MD5 DIGESTER;
		
		/// <summary>A buffer optionally used in renameTo method </summary>
		private byte[] buffer = null;
		
		/// <summary>Returns the directory instance for the named location.</summary>
		/// <param name="path">the path to the directory.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.String path)
		{
			return GetDirectory(new System.IO.FileInfo(path), null);
		}
		
		/// <summary>Returns the directory instance for the named location.</summary>
		/// <param name="path">the path to the directory.
		/// </param>
		/// <param name="lockFactory">instance of {@link LockFactory} providing the
		/// locking implementation.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.String path, LockFactory lockFactory)
		{
			return GetDirectory(new System.IO.FileInfo(path), lockFactory);
		}
		
		/// <summary>Returns the directory instance for the named location.</summary>
		/// <param name="file">the path to the directory.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.IO.FileInfo file)
		{
			return GetDirectory(file, null);
		}
		
		/// <summary>Returns the directory instance for the named location.</summary>
		/// <param name="file">the path to the directory.
		/// </param>
		/// <param name="lockFactory">instance of {@link LockFactory} providing the
		/// locking implementation.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.IO.FileInfo file, LockFactory lockFactory)
		{
			file = new System.IO.FileInfo(file.FullName);
			
			bool tmpBool;
			if (System.IO.File.Exists(file.FullName))
				tmpBool = true;
			else
				tmpBool = System.IO.Directory.Exists(file.FullName);
			if (tmpBool && !System.IO.Directory.Exists(file.FullName))
				throw new System.IO.IOException(file + " not a directory");
			
			bool tmpBool2;
			if (System.IO.File.Exists(file.FullName))
				tmpBool2 = true;
			else
				tmpBool2 = System.IO.Directory.Exists(file.FullName);
			if (!tmpBool2)
			{
                try
                {
                    System.IO.Directory.CreateDirectory(file.FullName);
                }
                catch
                {
                    throw new System.IO.IOException("Cannot create directory: " + file);
                }
			}
			
			FSDirectory dir;
			lock (DIRECTORIES.SyncRoot)
			{
				dir = (FSDirectory) DIRECTORIES[file];
				if (dir == null)
				{
					try
					{
						dir = (FSDirectory) System.Activator.CreateInstance(IMPL);
					}
					catch (System.Exception e)
					{
						throw new System.SystemException("cannot load FSDirectory class: " + e.ToString(), e);
					}
					dir.Init(file, lockFactory);
					DIRECTORIES[file] = dir;
				}
				else
				{
					// Catch the case where a Directory is pulled from the cache, but has a
					// different LockFactory instance.
					if (lockFactory != null && lockFactory != dir.GetLockFactory())
					{
						throw new System.IO.IOException("Directory was previously created with a different LockFactory instance; please pass null as the lockFactory instance and use setLockFactory to change it");
					}
				}
			}
			lock (dir)
			{
				dir.refCount++;
			}
			return dir;
		}
		
		
		/// <summary>Returns the directory instance for the named location.
		/// 
		/// </summary>
		/// <deprecated> Use IndexWriter's create flag, instead, to
		/// create a new index.
		/// 
		/// </deprecated>
		/// <param name="path">the path to the directory.
		/// </param>
		/// <param name="create">if true, create, or erase any existing contents.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.String path, bool create)
		{
			return GetDirectory(new System.IO.FileInfo(path), create);
		}
		
		/// <summary>Returns the directory instance for the named location.
		/// 
		/// </summary>
		/// <deprecated> Use IndexWriter's create flag, instead, to
		/// create a new index.
		/// 
		/// </deprecated>
		/// <param name="file">the path to the directory.
		/// </param>
		/// <param name="create">if true, create, or erase any existing contents.
		/// </param>
		/// <returns> the FSDirectory for the named file.  
		/// </returns>
		public static FSDirectory GetDirectory(System.IO.FileInfo file, bool create)
		{
			FSDirectory dir = GetDirectory(file, null);
			
			// This is now deprecated (creation should only be done
			// by IndexWriter):
			if (create)
			{
				dir.Create();
			}
			
			return dir;
		}
		
		private void  Create()
		{
			bool tmpBool;
			if (System.IO.File.Exists(directory.FullName))
				tmpBool = true;
			else
				tmpBool = System.IO.Directory.Exists(directory.FullName);
			if (tmpBool)
			{
                System.String[] files = System.IO.Directory.GetFileSystemEntries(directory.FullName);   // directory.list(IndexFileNameFilter.GetFilter()); // clear old files  // {{Aroush-2.1}} we don't want all files in the directory but a filtered list
				if (files == null)
					throw new System.IO.IOException("Cannot read directory " + directory.FullName);
				for (int i = 0; i < files.Length; i++)
				{
					System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, files[i]));
					bool tmpBool2;
					if (System.IO.File.Exists(file.FullName))
					{
						System.IO.File.Delete(file.FullName);
						tmpBool2 = true;
					}
					else if (System.IO.Directory.Exists(file.FullName))
					{
						System.IO.Directory.Delete(file.FullName);
						tmpBool2 = true;
					}
					else
						tmpBool2 = false;
					if (!tmpBool2)
						throw new System.IO.IOException("Cannot delete " + file);
				}
			}
			lockFactory.ClearLock(IndexWriter.WRITE_LOCK_NAME);
		}
		
		private System.IO.FileInfo directory = null;
		private int refCount;
		
		public FSDirectory()
		{
		}
		
		// permit subclassing
		
		private void  Init(System.IO.FileInfo path, LockFactory lockFactory)
		{
			
			// Set up lockFactory with cascaded defaults: if an instance was passed in,
			// use that; else if locks are disabled, use NoLockFactory; else if the
			// system property Lucene.Net.Store.FSDirectoryLockFactoryClass is set,
			// instantiate that; else, use SimpleFSLockFactory:
			
			directory = path;
			
			bool doClearLockID = false;
			
			if (lockFactory == null)
			{
				
				if (disableLocks)
				{
					// Locks are disabled:
					lockFactory = NoLockFactory.GetNoLockFactory();
				}
				else
				{
					System.String lockClassName = SupportClass.AppSettings.Get("Lucene.Net.Store.FSDirectoryLockFactoryClass", "");
					
					if (lockClassName != null && !lockClassName.Equals(""))
					{
						System.Type c;
						
						try
						{
							c = System.Type.GetType(lockClassName);
						}
						catch (System.Exception)
						{
							throw new System.IO.IOException("unable to find LockClass " + lockClassName);
						}
						
						try
						{
							lockFactory = (LockFactory) System.Activator.CreateInstance(c);
						}
						catch (System.UnauthorizedAccessException e)
						{
							throw new System.IO.IOException("IllegalAccessException when instantiating LockClass " + lockClassName);
						}
						catch (System.InvalidCastException)
						{
							throw new System.IO.IOException("unable to cast LockClass " + lockClassName + " instance to a LockFactory");
						}
                        catch (System.Exception)
                        {
                            throw new System.IO.IOException("InstantiationException when instantiating LockClass " + lockClassName);
                        }
                    }
					else
					{
						// Our default lock is SimpleFSLockFactory;
						// default lockDir is our index directory:
						lockFactory = new SimpleFSLockFactory(path);
						doClearLockID = true;
					}
				}
			}
			
			SetLockFactory(lockFactory);
			
			if (doClearLockID)
			{
				// Clear the prefix because write.lock will be
				// stored in our directory:
				lockFactory.SetLockPrefix(null);
			}
		}
		
		/// <summary>Returns an array of strings, one for each Lucene index file in the directory. </summary>
		public override System.String[] List()
		{
            System.String[] files = System.IO.Directory.GetFileSystemEntries(directory.FullName);   // IndexFileNameFilter.GetFilter());   // {{Aroush-2.1}} we want to limit the files to the list
            for (int i = 0; i < files.Length; i++)
            {
                System.IO.FileInfo fi = new System.IO.FileInfo(files[i]);
                files[i] = fi.Name;
            }
			return files;
		}
		
		/// <summary>Returns true iff a file with the given name exists. </summary>
		public override bool FileExists(System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			bool tmpBool;
			if (System.IO.File.Exists(file.FullName))
				tmpBool = true;
			else
				tmpBool = System.IO.Directory.Exists(file.FullName);
			return tmpBool;
		}
		
		/// <summary>Returns the time the named file was last modified. </summary>
		public override long FileModified(System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			return (file.LastWriteTime.Ticks);
		}
		
		/// <summary>Returns the time the named file was last modified. </summary>
		public static long FileModified(System.IO.FileInfo directory, System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			return (file.LastWriteTime.Ticks);
		}
		
		/// <summary>Set the modified time of an existing file to now. </summary>
		public override void  TouchFile(System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			file.LastWriteTime = System.DateTime.Now;
		}
		
		/// <summary>Returns the length in bytes of a file in the directory. </summary>
		public override long FileLength(System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			return file.Exists ? file.Length : 0;
		}
		
		/// <summary>Removes an existing file in the directory. </summary>
		public override void  DeleteFile(System.String name)
		{
			System.IO.FileInfo file = new System.IO.FileInfo(System.IO.Path.Combine(directory.FullName, name));
			bool tmpBool;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美腿丝袜在线亚洲一区| 成人免费看的视频| 综合电影一区二区三区 | 国产精品美女久久久久aⅴ国产馆| 日本高清不卡视频| 国产乱理伦片在线观看夜一区| 亚洲一区二区三区视频在线| 久久精品男人的天堂| 精品视频123区在线观看| 成人av片在线观看| 韩国精品一区二区| 婷婷成人综合网| 一区二区成人在线| 国产精品久久久久一区| 欧美日本一区二区在线观看| 欧美精品一区二区在线观看| 欧美性一级生活| 成人高清视频在线| 国产一区二区伦理| 奇米777欧美一区二区| 亚洲国产sm捆绑调教视频 | 国产精品少妇自拍| 日韩一区二区在线看| 欧美三区在线视频| 色爱区综合激月婷婷| 成人福利视频网站| 国产一区二区毛片| 国产乱子轮精品视频| 免费成人在线播放| 日韩精品电影一区亚洲| 亚洲成人在线免费| 午夜在线成人av| 亚洲电影欧美电影有声小说| 亚洲成人午夜电影| 亚洲第一福利一区| 亚洲va国产va欧美va观看| 亚洲精品乱码久久久久久久久 | 国产精品久久久久影院色老大 | 国产精品国产三级国产aⅴ入口| 国产亚洲欧美激情| 久久色在线视频| 久久先锋资源网| 国产亚洲欧美日韩在线一区| 国产丝袜欧美中文另类| 国产欧美日韩精品a在线观看| 欧美国产日韩一二三区| 中文字幕av一区二区三区免费看| 欧美国产在线观看| 最新中文字幕一区二区三区| 亚洲女人小视频在线观看| 亚洲美女精品一区| 一区二区三区日本| 日韩福利视频导航| 国产一区二区在线观看视频| 国产大陆精品国产| caoporn国产一区二区| 91在线视频播放| 欧美午夜精品一区| 日韩一级欧美一级| 亚洲国产高清aⅴ视频| 亚洲欧洲国产专区| 午夜久久久久久电影| 久久不见久久见免费视频7| 国产99一区视频免费| 色爱区综合激月婷婷| 欧美男男青年gay1069videost | 日韩中文字幕av电影| 精一区二区三区| 风间由美中文字幕在线看视频国产欧美| 成人精品一区二区三区四区| 欧美性三三影院| 精品av久久707| 亚洲精品成人精品456| 日韩电影在线观看电影| 成人三级伦理片| 欧美日韩一本到| 国产亚洲欧美日韩在线一区| 亚洲网友自拍偷拍| 国产一区二区三区美女| 91麻豆产精品久久久久久| 91精品午夜视频| 中文字幕精品在线不卡| 亚洲1区2区3区视频| 国产91清纯白嫩初高中在线观看| 欧美中文字幕一区| 2020日本不卡一区二区视频| 亚洲无人区一区| 丰满岳乱妇一区二区三区 | 国产精品久久久久久久久搜平片 | 日韩毛片一二三区| 日韩成人dvd| 91丨porny丨国产| 欧美videofree性高清杂交| 亚洲欧洲日产国产综合网| 看国产成人h片视频| 色诱亚洲精品久久久久久| 日韩一区二区影院| 一区二区三区在线观看网站| 国模一区二区三区白浆| 欧美午夜精品久久久久久孕妇| 国产午夜精品久久| 青青青爽久久午夜综合久久午夜| 91看片淫黄大片一级| 久久久亚洲午夜电影| 天天综合色天天综合色h| 91美女片黄在线观看91美女| 欧美精品一区二区三区蜜桃视频 | 国产午夜一区二区三区| 天天免费综合色| 一本色道**综合亚洲精品蜜桃冫| 久久久一区二区| 久久精品免费观看| 欧美日韩免费在线视频| 最近日韩中文字幕| 国产福利一区二区三区视频在线| 欧美一级在线免费| 亚洲成年人影院| 欧美亚洲一区三区| 亚洲欧美日韩国产成人精品影院 | 亚洲色图制服诱惑| 福利一区在线观看| 国产亚洲午夜高清国产拍精品 | 成人白浆超碰人人人人| 国产三级一区二区三区| 美国毛片一区二区三区| 69堂国产成人免费视频| 亚洲动漫第一页| 欧美怡红院视频| 一区二区三区日韩欧美| 色94色欧美sute亚洲线路一ni| 中文字幕中文字幕中文字幕亚洲无线| 国产一区二区网址| 久久久久综合网| 国产精品12区| 国产精品免费久久| 国产成人av电影在线播放| 国产欧美一区二区精品性色超碰| 国产成人精品www牛牛影视| 久久精品视频一区二区| 国产精品一区二区在线播放| 久久久久久久精| 国产99久久久国产精品潘金网站| 欧美国产精品v| 丁香婷婷综合五月| 亚洲三级小视频| 在线视频综合导航| 亚洲高清久久久| 欧美剧在线免费观看网站| 秋霞成人午夜伦在线观看| 精品国产一区二区精华| 国产激情一区二区三区四区| 国产精品国产a| 91福利视频久久久久| 日韩电影一区二区三区| 欧美不卡一区二区三区| 国产激情视频一区二区在线观看 | 韩国av一区二区| 国产欧美日本一区二区三区| 91女人视频在线观看| 亚洲成av人影院| 久久这里只有精品视频网| 成人激情av网| 亚洲午夜一区二区| 2021中文字幕一区亚洲| 91在线观看视频| 视频一区二区国产| 国产日韩欧美一区二区三区综合| 色综合久久六月婷婷中文字幕| 午夜久久久久久电影| 久久精品欧美日韩精品| 在线观看亚洲精品视频| 精品在线观看视频| 中文字幕中文乱码欧美一区二区| 在线观看日韩av先锋影音电影院| 蜜臀久久99精品久久久画质超高清| 欧美激情综合五月色丁香小说| 欧美天堂一区二区三区| 国精产品一区一区三区mba视频| 国产精品久久毛片| 欧美精品久久99久久在免费线 | 亚洲精品在线免费观看视频| 91同城在线观看| 六月丁香婷婷久久| 亚洲人123区| 欧美mv日韩mv国产网站app| 99精品视频中文字幕| 久久国产视频网| 一区二区三区**美女毛片| 久久久久亚洲综合| 欧美三电影在线| jlzzjlzz欧美大全| 欧美a级理论片| 亚洲免费观看高清在线观看| 欧美精品一区二区三区四区 | 亚洲国产乱码最新视频| 国产精品网站一区| 正在播放亚洲一区| 日本高清不卡视频| 岛国精品一区二区| 久久99精品久久久久久动态图|