Package com.googlecode.lucene.gae.datastore.file

Examples of com.googlecode.lucene.gae.datastore.file.DataStoreFile


    TestUtils.setUp();

    repository = new DataStoreFileRepository("teste");

    DataStoreFile file1 = createDataStoreFile("teste1");
    DataStoreFile file2 = createDataStoreFile("teste2");
    DataStoreFile file3 = createDataStoreFile("teste3");
    repository.put(file1);
    repository.put(file2);
    repository.put(file3);

  }
View Full Code Here


  }

  @Test
  public void testDelete() {
    repository.delete("teste1");
    DataStoreFile file = repository.get("teste1");
    assertNull(file);
  }
View Full Code Here

    assertNull(file);
  }

  @Test
  public void testGet() {
    DataStoreFile file = repository.get("teste1");
    assertNotNull(file);
  }
View Full Code Here

    assertEquals(expected, list.size());
  }

  @Test
  public void testPut() throws IOException {
    DataStoreFile file = createDataStoreFile("teste4");
    repository.put(file);
  }
View Full Code Here

    DataStoreFile file = createDataStoreFile("teste4");
    repository.put(file);
  }

  private DataStoreFile createDataStoreFile(String name) throws IOException {
    DataStoreFile result = new DataStoreFile(name);
    result.createNewPart();
    result.createNewPart();
    result.createNewPart();
    return result;
  }
View Full Code Here

  }

  @Override
  public IndexOutput createOutput(String name) throws IOException {

    DataStoreFile file = new DataStoreFile(name);

    repository.put(file);

    return new DataStoreIndexOutput(file, repository);
View Full Code Here

  @Override
  public boolean fileExists(String name) throws IOException {

    try {
      DataStoreFile file = getFileByName(name, false);
      return file != null;
    } catch (FileNotFoundException e) {
      return false;
    }
View Full Code Here

  }

  @Override
  public long fileLength(String name) throws IOException {

    DataStoreFile file = getFileByName(name, true);

    return file.getLength();

  }
View Full Code Here

  }

  @Override
  public long fileModified(String name) throws IOException {

    DataStoreFile file = getFileByName(name, false);

    return file.getLastModified();

  }
View Full Code Here

  }

  @Override
  public IndexInput openInput(String name) throws IOException {

    DataStoreFile file = getFileByName(name, true);

    return new DataStoreIndexInput(file);

  }
View Full Code Here

TOP

Related Classes of com.googlecode.lucene.gae.datastore.file.DataStoreFile

Copyright © 2018 www.massapicom. 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.