Examples of fileExists()


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

        // Make sure we really did close the dir inside IndexReader.open
        dir.close();

        try {
          dir.fileExists("hi");
          fail("did not hit expected exception");
        } catch (AlreadyClosedException ace) {
          // expected
        }
      } finally {
View Full Code Here

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

    // Create some old segments file:
    copyFile(dir, "segments_2", "segments");
    copyFile(dir, "segments_2", "segments_1");

    // Create a bogus cfs file shadowing a non-cfs segment:
    assertTrue(dir.fileExists("_3.fdt"));
    assertTrue(!dir.fileExists("_3.cfs"));
    copyFile(dir, "_1.cfs", "_3.cfs");
   
    String[] filesPre = dir.listAll();
View Full Code Here

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

    copyFile(dir, "segments_2", "segments");
    copyFile(dir, "segments_2", "segments_1");

    // Create a bogus cfs file shadowing a non-cfs segment:
    assertTrue(dir.fileExists("_3.fdt"));
    assertTrue(!dir.fileExists("_3.cfs"));
    copyFile(dir, "_1.cfs", "_3.cfs");
   
    String[] filesPre = dir.listAll();

    // Open & close a writer: it should delete the above 4
View Full Code Here

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

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

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new MockDirectoryWrapper(random, new RAMDirectory(dir));
      assertTrue(!dir2.fileExists("myrandomfile"));
      dir2.close();
    } finally {
      dir.close();
    }
  }
View Full Code Here

Examples of org.apache.lucene.store.MockRAMDirectory.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.MockRAMDirectory.fileExists()

        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir);
        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.MockRAMDirectory.fileExists()

        //  now open reader again & set norm for doc 0 (writes to _0_2.s0)
        reader = IndexReader.open(dir);
        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.NRTCachingDirectory.fileExists()

                iw.commit();
                IndexCommit ic = sdp.snapshot();
                for (String name : ic.getFileNames()) {
                  //distribute, and backup
                  //System.out.println(names);
                  assertTrue(dir.fileExists(name));
                }
              } catch (Exception e) {
                throw new RuntimeException(e);
              }
            }
View Full Code Here

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

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

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new RAMDirectory(dir);
      assertTrue(!dir2.fileExists("myrandomfile"));

    } finally {
      dir.close();
      _TestUtil.rmDir(indexDir);
    }
View Full Code Here

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

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

      // Make sure this does not copy myrandomfile:
      Directory dir2 = new RAMDirectory(dir);
      assertTrue(!dir2.fileExists("myrandomfile"));

    } finally {
      dir.close();
      _TestUtil.rmDir(indexDir);
    }
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.