Examples of fileExists()


Examples of org.apache.lucene.store.CompoundFileDirectory.fileExists()

    if (Lucene3xSegmentInfoFormat.getDocStoreOffset(segmentInfo) != -1 && Lucene3xSegmentInfoFormat.getDocStoreIsCompoundFile(segmentInfo)) {
      String cfxFileName = IndexFileNames.segmentFileName(Lucene3xSegmentInfoFormat.getDocStoreSegment(segmentInfo), "", Lucene3xCodec.COMPOUND_FILE_STORE_EXTENSION);
      if (segmentInfo.dir.fileExists(cfxFileName)) {
        Directory cfsDir = new CompoundFileDirectory(segmentInfo.dir, cfxFileName, context, false);
        try {
          exists = cfsDir.fileExists(fileName);
        } finally {
          cfsDir.close();
        }
      } else {
        exists = false;
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir, false);
        reader.setNorm(0, "content", (float) 2.0);
        reader.close();
        assertFalse("failed to remove first generation norms file on writing second generation",
                    dir.fileExists("_0_1.s0"));
       
        dir.close();
    }

    /* ??? public void testOpenEmptyDirectory() throws IOException{
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir, false);
        reader.setNorm(0, "content", (float) 2.0);
        reader.close();
        assertFalse("failed to remove first generation norms file on writing second generation",
                    dir.fileExists("_0_1.s0"));
       
        dir.close();
    }

View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      out.writeByte((byte) 42);
      out.close();
     
      new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random()))).close();
     
      assertTrue(dir.fileExists("myrandomfile"));
    } finally {
      dir.close();
    }
  }
 
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      out.writeByte((byte) 42);
      out.close();
     
      new IndexWriter(dir, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random()))).close();
     
      assertTrue(dir.fileExists("_a.frq"));
     
      IndexWriter iw = new IndexWriter(dir,
          newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
      iw.addDocument(new Document());
      iw.close();
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      IndexWriter iw = new IndexWriter(dir,
          newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
      iw.addDocument(new Document());
      iw.close();
     
      assertFalse(dir.fileExists("_a.frq"));
    } finally {
      dir.close();
    }
  }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

          dirToTest = new CompoundFileReader(dir, IndexFileNames.segmentFileName(storesSegment, ext), IndexFileNames.segmentFileName(storesSegment, extpos));
        } else {
          dirToTest = dir;
        }
        try {
          hasVectors = dirToTest.fileExists(IndexFileNames.segmentFileName(storesSegment, IndexFileNames.VECTORS_INDEX_EXTENSION));
        } finally {
          if (isCompoundFile) {
            dirToTest.close();
          }
        }
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

    // create separate norms file
    IndexReader r = IndexReader.open(src, false);
    r.setNorm(0, "c", (byte) 1);
    r.close();
    assertTrue(".del file not found", src.fileExists("_0_1.del"));
    assertTrue("separate norms file not found", src.fileExists("_0_1.s0"));
   
    // Case 1: force 'CFS' on target
    lmp.setUseCompoundFile(true);
    lmp.setNoCFSRatio(1.0);
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

    // create separate norms file
    IndexReader r = IndexReader.open(src, false);
    r.setNorm(0, "c", (byte) 1);
    r.close();
    assertTrue(".del file not found", src.fileExists("_0_1.del"));
    assertTrue("separate norms file not found", src.fileExists("_0_1.s0"));
   
    // Case 1: force 'CFS' on target
    lmp.setUseCompoundFile(true);
    lmp.setNoCFSRatio(1.0);
    w.addIndexes(src);
View Full Code Here

Examples of org.apache.lucene.store.Directory.fileExists()

      out.writeByte((byte) 42);
      out.close();

      new IndexWriter(dir, new WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED).close();

      assertTrue(dir.fileExists("myrandomfile"));

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new RAMDirectory(dir);
      assertTrue(!dir2.fileExists("myrandomfile"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.