Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void split(java.io.File destDir, String[] segs) throws java.io.IOException
        public virtual void Split(File destDir, string[] segs)
        {
            destDir.mkdirs();
            FSDirectory  destFSDir = FSDirectory.open(destDir);
            SegmentInfos destInfos = new SegmentInfos();

            destInfos.counter = infos.counter;
            foreach (string n in segs)
            {
                SegmentCommitInfo infoPerCommit = getInfo(n);
                SegmentInfo       info          = infoPerCommit.info;
                // Same info just changing the dir:
                SegmentInfo newInfo = new SegmentInfo(destFSDir, info.Version, info.name, info.DocCount, info.UseCompoundFile, info.Codec, info.Diagnostics);
                destInfos.add(new SegmentCommitInfo(newInfo, infoPerCommit.DelCount, infoPerCommit.DelGen, infoPerCommit.FieldInfosGen));
                // now copy files over
                ICollection <string> files = infoPerCommit.files();
                foreach (String srcName in files)
                {
                    File srcFile  = new File(dir, srcName);
                    File destFile = new File(destDir, srcName);
                    copyFile(srcFile, destFile);
                }
            }
            destInfos.changed();
            destInfos.commit(destFSDir);
            // System.out.println("destDir:"+destDir.getAbsolutePath());
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void remove(String[] segs) throws java.io.IOException
        public virtual void remove(string[] segs)
        {
            foreach (string n in segs)
            {
                int idx = getIdx(n);
                infos.remove(idx);
            }
            infos.changed();
            infos.commit(fsDir);
        }
Exemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void split(java.io.File destDir, String[] segs) throws java.io.IOException
	  public virtual void Split(File destDir, string[] segs)
	  {
		destDir.mkdirs();
		FSDirectory destFSDir = FSDirectory.open(destDir);
		SegmentInfos destInfos = new SegmentInfos();
		destInfos.counter = infos.counter;
		foreach (string n in segs)
		{
		  SegmentCommitInfo infoPerCommit = getInfo(n);
		  SegmentInfo info = infoPerCommit.info;
		  // Same info just changing the dir:
		  SegmentInfo newInfo = new SegmentInfo(destFSDir, info.Version, info.name, info.DocCount, info.UseCompoundFile, info.Codec, info.Diagnostics);
		  destInfos.add(new SegmentCommitInfo(newInfo, infoPerCommit.DelCount, infoPerCommit.DelGen, infoPerCommit.FieldInfosGen));
		  // now copy files over
		  ICollection<string> files = infoPerCommit.files();
		  foreach (String srcName in files)
		  {
			File srcFile = new File(dir, srcName);
			File destFile = new File(destDir, srcName);
			copyFile(srcFile, destFile);
		  }
		}
		destInfos.changed();
		destInfos.commit(destFSDir);
		// System.out.println("destDir:"+destDir.getAbsolutePath());
	  }