Package com.googlecode.lucene.gae.blobstore.wrapper

Examples of com.googlecode.lucene.gae.blobstore.wrapper.AppEngineFileWrapper


  }

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

    AppEngineFileWrapper fileWrapper = fileWrapperRepository.get(name);

    if (fileWrapper == null) {
      fileWrapper = new AppEngineFileWrapper(name);
      fileWrapperRepository.put(fileWrapper);
    }

    return new BlobStoreIndexOutput(fileWrapper);
View Full Code Here


  }

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

    AppEngineFileWrapper file = getFileByName(name);

    return file.getLength();

  }
View Full Code Here

  }

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

    AppEngineFileWrapper file = getFileByName(name);

    return file.getLastModified();

  }
View Full Code Here

  }

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

    AppEngineFileWrapper fileWrapper = getFileByName(name);

    return new BlobStoreIndexInput(fileWrapper);

  }
View Full Code Here

  }

  @Override
  public void touchFile(String name) throws IOException {

    AppEngineFileWrapper file = getFileByName(name);

    long now = System.currentTimeMillis();

    file.updateLastModified(now);

  }
View Full Code Here

  }

  private AppEngineFileWrapper getFileByName(String name) throws FileNotFoundException {

    AppEngineFileWrapper file = fileWrapperRepository.get(name);

    if (file == null) {
      throw new FileNotFoundException(name);
    }
View Full Code Here

  }

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

    assertNull(file);
  }

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

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

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

    AppEngineFileWrapper file = createAppEngineFileWrapper("teste4");
    repository.put(file);
  }

  private AppEngineFileWrapper createAppEngineFileWrapper(String name) throws IOException {
    return new AppEngineFileWrapper(name);
  }
View Full Code Here

TOP

Related Classes of com.googlecode.lucene.gae.blobstore.wrapper.AppEngineFileWrapper

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.